expose blockSelector as a public option
This commit is contained in:
@@ -33,6 +33,7 @@ function record<T = eventWithTime>(
|
||||
checkoutEveryNms,
|
||||
checkoutEveryNth,
|
||||
blockClass = 'rr-block',
|
||||
blockSelector = null,
|
||||
ignoreClass = 'rr-ignore',
|
||||
inlineStylesheet = true,
|
||||
maskAllInputs,
|
||||
@@ -130,6 +131,7 @@ function record<T = eventWithTime>(
|
||||
mutationBuffer.freeze(); // don't allow any mirror modifications during snapshotting
|
||||
const [node, idNodeMap] = snapshot(document, {
|
||||
blockClass,
|
||||
blockSelector,
|
||||
inlineStylesheet,
|
||||
maskAllInputs: maskInputOptions,
|
||||
recordCanvas,
|
||||
@@ -289,6 +291,7 @@ function record<T = eventWithTime>(
|
||||
}),
|
||||
),
|
||||
blockClass,
|
||||
blockSelector,
|
||||
ignoreClass,
|
||||
maskInputOptions,
|
||||
maskInputFn,
|
||||
|
||||
@@ -141,6 +141,7 @@ export default class MutationBuffer {
|
||||
|
||||
private emissionCallback: mutationCallBack;
|
||||
private blockClass: blockClass;
|
||||
private blockSelector: string | null;
|
||||
private inlineStylesheet: boolean;
|
||||
private maskInputOptions: MaskInputOptions;
|
||||
private recordCanvas: boolean;
|
||||
@@ -148,11 +149,13 @@ export default class MutationBuffer {
|
||||
public init(
|
||||
cb: mutationCallBack,
|
||||
blockClass: blockClass,
|
||||
blockSelector: string | null,
|
||||
inlineStylesheet: boolean,
|
||||
maskInputOptions: MaskInputOptions,
|
||||
recordCanvas: boolean,
|
||||
) {
|
||||
this.blockClass = blockClass;
|
||||
this.blockSelector = blockSelector;
|
||||
this.inlineStylesheet = inlineStylesheet;
|
||||
this.maskInputOptions = maskInputOptions;
|
||||
this.recordCanvas = recordCanvas;
|
||||
@@ -213,7 +216,7 @@ export default class MutationBuffer {
|
||||
doc: document,
|
||||
map: mirror.map,
|
||||
blockClass: this.blockClass,
|
||||
blockSelector: null,
|
||||
blockSelector: this.blockSelector,
|
||||
skipChild: true,
|
||||
inlineStylesheet: this.inlineStylesheet,
|
||||
maskInputOptions: this.maskInputOptions,
|
||||
|
||||
@@ -44,6 +44,7 @@ export const mutationBuffer = new MutationBuffer();
|
||||
function initMutationObserver(
|
||||
cb: mutationCallBack,
|
||||
blockClass: blockClass,
|
||||
blockSelector: string | null,
|
||||
inlineStylesheet: boolean,
|
||||
maskInputOptions: MaskInputOptions,
|
||||
recordCanvas: boolean,
|
||||
@@ -52,6 +53,7 @@ function initMutationObserver(
|
||||
mutationBuffer.init(
|
||||
cb,
|
||||
blockClass,
|
||||
blockSelector,
|
||||
inlineStylesheet,
|
||||
maskInputOptions,
|
||||
recordCanvas,
|
||||
@@ -578,6 +580,7 @@ export function initObservers(
|
||||
const mutationObserver = initMutationObserver(
|
||||
o.mutationCb,
|
||||
o.blockClass,
|
||||
o.blockSelector,
|
||||
o.inlineStylesheet,
|
||||
o.maskInputOptions,
|
||||
o.recordCanvas,
|
||||
|
||||
@@ -171,6 +171,7 @@ export type recordOptions<T> = {
|
||||
checkoutEveryNth?: number;
|
||||
checkoutEveryNms?: number;
|
||||
blockClass?: blockClass;
|
||||
blockSelector?: string;
|
||||
ignoreClass?: string;
|
||||
maskAllInputs?: boolean;
|
||||
maskInputOptions?: MaskInputOptions;
|
||||
@@ -194,6 +195,7 @@ export type observerParam = {
|
||||
inputCb: inputCallback;
|
||||
mediaInteractionCb: mediaInteractionCallback;
|
||||
blockClass: blockClass;
|
||||
blockSelector: string | null;
|
||||
ignoreClass: string;
|
||||
maskInputOptions: MaskInputOptions;
|
||||
maskInputFn?: MaskInputFn;
|
||||
|
||||
Reference in New Issue
Block a user