moonshot-rails 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/app/assets/javascripts/moonshot.js +41 -12
- data/lib/moonshot-rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 267a4749786b23adbc02bc666be3043bb2f3a29a27b9fc811c2d6bcd558ed7a8
|
4
|
+
data.tar.gz: 1274e6d80f830c37ae7800e42338d887516cea203c813b0c047b6cf5e558f6e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0eebc47467f82c19e79e059041d8d488d01cf30dd890ccba7b41cf6ec63c8a66f0a31e6d2c56012821a7c51c73bd25524fb093e3d69006cd3c7529b47610f8b
|
7
|
+
data.tar.gz: 96bd0210245d379cfb1f5c8935d27fbb07b4f31fa7ea5dd71c16ef1375aca59f10db77adf1f173dbd95dd9949860e1883433ac95c3ff910a7aa0fc62aafbc88b
|
data/README.md
CHANGED
@@ -1,7 +1,35 @@
|
|
1
|
-
import
|
1
|
+
import posthog from "posthog-js";
|
2
2
|
|
3
3
|
import { Controller } from "@hotwired/stimulus";
|
4
4
|
|
5
|
+
import { post } from "@rails/request.js";
|
6
|
+
|
7
|
+
class PostHogController extends Controller {
|
8
|
+
static values={
|
9
|
+
apiKey: String,
|
10
|
+
identification: Object
|
11
|
+
};
|
12
|
+
connect() {
|
13
|
+
posthog.init(this.apiKeyValue, {
|
14
|
+
api_host: "https://eu.posthog.com",
|
15
|
+
custom_campaign_params: [ "ref" ],
|
16
|
+
session_recording: {
|
17
|
+
maskAllInputs: false,
|
18
|
+
maskInputOptions: {
|
19
|
+
password: true
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
if (Object.keys(this.identificationValue).length) {
|
24
|
+
const {id: id, email: email, name: name} = this.identificationValue;
|
25
|
+
posthog.identify(id, {
|
26
|
+
email: email,
|
27
|
+
name: name
|
28
|
+
});
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
5
33
|
/*! shepherd.js 11.2.0 */ var isMergeableObject = function isMergeableObject(value) {
|
6
34
|
return isNonNullObject(value) && !isSpecial(value);
|
7
35
|
};
|
@@ -3554,7 +3582,7 @@ class Shepherd_modal extends SvelteComponent {
|
|
3554
3582
|
}
|
3555
3583
|
}
|
3556
3584
|
|
3557
|
-
const Shepherd
|
3585
|
+
const Shepherd = new Evented;
|
3558
3586
|
|
3559
3587
|
class Tour extends Evented {
|
3560
3588
|
constructor(options = {}) {
|
@@ -3574,7 +3602,7 @@ class Tour extends Evented {
|
|
3574
3602
|
this.on(e, (opts => {
|
3575
3603
|
opts = opts || {};
|
3576
3604
|
opts.tour = this;
|
3577
|
-
Shepherd
|
3605
|
+
Shepherd.trigger(e, opts);
|
3578
3606
|
}));
|
3579
3607
|
})(event);
|
3580
3608
|
}));
|
@@ -3635,7 +3663,7 @@ class Tour extends Evented {
|
|
3635
3663
|
}
|
3636
3664
|
}
|
3637
3665
|
isActive() {
|
3638
|
-
return Shepherd
|
3666
|
+
return Shepherd.activeTour === this;
|
3639
3667
|
}
|
3640
3668
|
next() {
|
3641
3669
|
const index = this.steps.indexOf(this.currentStep);
|
@@ -3696,7 +3724,7 @@ class Tour extends Evented {
|
|
3696
3724
|
this.trigger(event, {
|
3697
3725
|
index: index
|
3698
3726
|
});
|
3699
|
-
Shepherd
|
3727
|
+
Shepherd.activeTour = null;
|
3700
3728
|
this.trigger("inactive", {
|
3701
3729
|
tour: this
|
3702
3730
|
});
|
@@ -3719,7 +3747,7 @@ class Tour extends Evented {
|
|
3719
3747
|
this.trigger("active", {
|
3720
3748
|
tour: this
|
3721
3749
|
});
|
3722
|
-
Shepherd
|
3750
|
+
Shepherd.activeTour = this;
|
3723
3751
|
}
|
3724
3752
|
_setupModal() {
|
3725
3753
|
this.modal = new Shepherd_modal({
|
@@ -3760,18 +3788,18 @@ class NoOp {
|
|
3760
3788
|
}
|
3761
3789
|
|
3762
3790
|
if (isServerSide) {
|
3763
|
-
Object.assign(Shepherd
|
3791
|
+
Object.assign(Shepherd, {
|
3764
3792
|
Tour: NoOp,
|
3765
3793
|
Step: NoOp
|
3766
3794
|
});
|
3767
3795
|
} else {
|
3768
|
-
Object.assign(Shepherd
|
3796
|
+
Object.assign(Shepherd, {
|
3769
3797
|
Tour: Tour,
|
3770
3798
|
Step: Step
|
3771
3799
|
});
|
3772
3800
|
}
|
3773
3801
|
|
3774
|
-
class
|
3802
|
+
class ShepherdController extends Controller {
|
3775
3803
|
static values={
|
3776
3804
|
tourName: String,
|
3777
3805
|
endpoint: String,
|
@@ -3779,7 +3807,7 @@ class Shepherd extends Controller {
|
|
3779
3807
|
context: Object
|
3780
3808
|
};
|
3781
3809
|
initialize() {
|
3782
|
-
this.tour = new Shepherd
|
3810
|
+
this.tour = new Shepherd.Tour(this.configValue.tour);
|
3783
3811
|
}
|
3784
3812
|
connect() {
|
3785
3813
|
const steps = this.processTourConfigAction(this.configValue.steps);
|
@@ -3843,7 +3871,8 @@ class Shepherd extends Controller {
|
|
3843
3871
|
}
|
3844
3872
|
|
3845
3873
|
function registerControllers(application) {
|
3846
|
-
application.register("
|
3874
|
+
application.register("shepherd", ShepherdController);
|
3875
|
+
application.register("post-hog", PostHogController);
|
3847
3876
|
}
|
3848
3877
|
|
3849
|
-
export {
|
3878
|
+
export { PostHogController, ShepherdController, registerControllers };
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moonshot-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Catalin Ionescu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|