forked from microsoft/clarity
-
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.
Simplify selector logic in clarity-js (microsoft#174)
* Simplify selector logic in clarity-js * Addressing PR feedback * Bumping version to 0.6.26 * Reset counter after a successful history operation * Bug fixes related to shadow dom * Bug fix to enable standalone calls to merge function * Handling empty selectors * Ability to lookup value by hash and extension bug fixes
- Loading branch information
1 parent
0494b75
commit 4868c6b
Showing
41 changed files
with
447 additions
and
341 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
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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
import { Interaction } from "clarity-js"; | ||
import { PartialEvent } from "./core"; | ||
|
||
export interface ClickData extends Interaction.ClickData { | ||
hashBeta: string; | ||
} | ||
|
||
export interface TimelineData extends Interaction.TimelineData { | ||
hashBeta: string; | ||
} | ||
|
||
export interface InputEvent extends PartialEvent { data: Interaction.InputData; } | ||
export interface ClickEvent extends PartialEvent { data: Interaction.ClickData; } | ||
export interface ClickEvent extends PartialEvent { data: ClickData; } | ||
export interface PointerEvent extends PartialEvent { data: Interaction.PointerData; } | ||
export interface ResizeEvent extends PartialEvent { data: Interaction.ResizeData; } | ||
export interface ScrollEvent extends PartialEvent { data: Interaction.ScrollData; } | ||
export interface SelectionEvent extends PartialEvent { data: Interaction.SelectionData; } | ||
export interface TimelineEvent extends PartialEvent { data: Interaction.TimelineData; } | ||
export interface TimelineEvent extends PartialEvent { data: TimelineData; } | ||
export interface UnloadEvent extends PartialEvent { data: Interaction.UnloadData; } | ||
export interface VisibilityEvent extends PartialEvent { data: Interaction.VisibilityData; } | ||
export interface InteractionEvent extends PartialEvent { | ||
data: Interaction.ClickData | | ||
data: ClickData | | ||
Interaction.InputData | | ||
Interaction.PointerData | | ||
Interaction.ResizeData | | ||
Interaction.ScrollData | | ||
Interaction.SelectionData | | ||
Interaction.TimelineData | | ||
TimelineData | | ||
Interaction.UnloadData | | ||
Interaction.VisibilityData; | ||
} |
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,20 @@ | ||
import { clarity, version, helper } from "clarity-js"; | ||
|
||
// Execute clarity-js in context of the webpage | ||
(function(): void { | ||
if (typeof window !== "undefined") { | ||
const w = window as any; | ||
const c = 'clarity'; | ||
|
||
// Stop any existing instance of clarity-js | ||
if (w[c]) { w[c]("stop"); } | ||
|
||
// Re-wire clarity-js for developer tools and expose helper methods as part of the global object | ||
w[c] = function(method: string, ...args: any[]): void { return clarity[method](...args); } | ||
w[c].h = function(method: string, ...args: any[]): void { return helper[method](...args); } | ||
w[c].v = version; | ||
|
||
// Notify developer tools that clarity-js is wired up | ||
window.postMessage({ action: "wireup" }, "*"); | ||
} | ||
})(); |
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
Oops, something went wrong.