-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-guided-tour' into dev
- Loading branch information
Showing
86 changed files
with
3,484 additions
and
1,925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
npm-debug.log | ||
testem.log | ||
yarn-error.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Ember from 'ember'; | ||
import { PropTypes } from 'ember-prop-types'; | ||
import * as HintUtil from 'textup-frontend/utils/hint-info'; | ||
|
||
const { computed } = Ember; | ||
|
||
export default Ember.Component.extend({ | ||
tutorialService: Ember.inject.service(), | ||
|
||
propTypes: { | ||
hintId: PropTypes.string.isRequired | ||
}, | ||
|
||
classNames: ['hint'], | ||
|
||
hintTitle: computed('hintId', function() { | ||
const hintId = this.get('hintId'); | ||
return HintUtil.getTitle(hintId); | ||
}), | ||
hintText: computed('hintId', function() { | ||
const hintId = this.get('hintId'); | ||
return HintUtil.getMessage(hintId); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import Ember from 'ember'; | ||
import PropTypesMixin, { PropTypes } from 'ember-prop-types'; | ||
import HasWormhole from 'textup-frontend/mixins/component/has-wormhole'; | ||
|
||
const { computed, $, tryInvoke } = Ember; | ||
|
||
export default Ember.Component.extend(PropTypesMixin, HasWormhole, { | ||
propTypes: { | ||
elementToHighlight: PropTypes.string, | ||
showOverlay: PropTypes.bool, | ||
doRegister: PropTypes.func, | ||
svgClasses: PropTypes.string | ||
}, | ||
|
||
getDefaultProps() { | ||
return { | ||
showOverlay: true | ||
}; | ||
}, | ||
|
||
init() { | ||
this._super(...arguments); | ||
tryInvoke(this, 'doRegister', [this.get('_publicAPI')]); | ||
}, | ||
|
||
_publicAPI: computed(function() { | ||
return { | ||
actions: { | ||
calculateCutout: this._setElementDimensions.bind(this), | ||
removeCutout: this._removeDimensions.bind(this) | ||
} | ||
}; | ||
}), | ||
|
||
_elementDimensions: null, | ||
_elementToWormhole: computed('_svgId', function() { | ||
return this.$('#' + this.get('_svgId')); | ||
}), | ||
|
||
_svgId: computed(function() { | ||
return `tour-manager--${this.elementId}`; | ||
}), | ||
|
||
_removeDimensions() { | ||
if (this.get('isDestroying') || this.get('isDestroyed')) { | ||
return; | ||
} | ||
this.set('_elementDimensions', null); | ||
}, | ||
|
||
_setElementDimensions() { | ||
if (this.get('isDestroying') || this.get('isDestroyed')) { | ||
return; | ||
} | ||
const elementToHighlight = $(this.get('elementToHighlight'))[0]; | ||
if (elementToHighlight) { | ||
const dimensions = elementToHighlight.getBoundingClientRect(); | ||
this.set('_elementDimensions', { | ||
x: dimensions.x, | ||
y: dimensions.y, | ||
width: dimensions.width, | ||
height: dimensions.height | ||
}); | ||
} | ||
} | ||
}); |
Oops, something went wrong.