Skip to content

Commit 8fccef0

Browse files
authored
Merge pull request #388 from nateplusplus/layer-depth
Add 'length' alias for layerDepth setting
2 parents 0a47327 + bd0866d commit 8fccef0

File tree

12 files changed

+116
-7
lines changed

12 files changed

+116
-7
lines changed

.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ module.exports = {
99
core: {
1010
builder: '@storybook/builder-webpack5',
1111
},
12+
typescript: {
13+
reactDocgen: 'react-docgen-typescript-plugin',
14+
},
1215
};

dist/esm/pushin.js

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/pushin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/types.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface SceneSettings {
3838
composition?: CompositionOptions;
3939
ratio?: number[];
4040
autoStart?: string;
41+
length?: number;
4142
}
4243
export interface PushInOptions {
4344
composition?: CompositionOptions;
@@ -49,15 +50,16 @@ export interface PushInOptions {
4950
scrollTarget?: string;
5051
mode?: string;
5152
autoStart?: string;
53+
length?: number;
5254
}
5355
export interface PushInSettings {
56+
mode: string;
5457
composition?: CompositionOptions;
5558
debug?: boolean;
5659
layers?: LayerOptions[];
5760
selector?: string;
5861
target?: string;
5962
scrollTarget?: string;
60-
mode: string;
6163
}
6264
export interface TargetSettings {
6365
target?: string;

dist/umd/pushin.js

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/umd/pushin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/umd/pushin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"lint-staged": "^13.0.3",
9393
"prettier": "^2.6.1",
9494
"react": "^18.2.0",
95+
"react-docgen-typescript-plugin": "^1.0.5",
9596
"react-dom": "^18.2.0",
9697
"rollup": "3.20.3",
9798
"rollup-plugin-copy": "3.4.0",

src/pushInScene.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class PushInScene extends PushInBase {
3232
layers: pushin.options?.layers || [],
3333
ratio: options?.ratio,
3434
autoStart: pushin.options?.autoStart,
35+
length: this.pushin.options?.length,
3536
};
3637

3738
this.layers = [];
@@ -92,6 +93,11 @@ export class PushInScene extends PushInBase {
9293
setLayerDepth() {
9394
let layerDepth = this.getNumberOption('layerDepth');
9495

96+
if (!layerDepth) {
97+
// use pushin 'length' setting as alias for layerDepth
98+
layerDepth = this.getNumberOption('length', this.pushin.container);
99+
}
100+
95101
if (layerDepth && typeof layerDepth !== 'number') {
96102
// not yet compatible with array - set to first index if array passed in.
97103
[layerDepth] = layerDepth;

0 commit comments

Comments
 (0)