Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
wfjsw committed Jan 12, 2024
1 parent e51a579 commit 6e99c33
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@commitlint/config-conventional"
]
},
"packageManager": "pnpm@7.9.4",
"packageManager": "pnpm@8.6.12+sha256.3ed40ffc6cbb00790ab325e9d3ff5517a3ed5b763ec53a411707b1702a411174",
"dependencies": {
"ts-jest": "^29.0.3"
},
Expand Down
7 changes: 0 additions & 7 deletions packages/core/src/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ export type WrapperWrapProps = Pick<
export type WrapperWrapFunction = (props: WrapperWrapProps) => string;
export type WrapperUnwrapFunction = (text: string) => Unwrapped;

export type WrapperAttributeXPathGetter = (props: {
tag: string;
attribute: string;
}) => string;

export type HighlightInterface = (key?: string, ns?: NsFallback) => Highlighter;
export type FindPositionsInterface = (
key?: string,
Expand Down Expand Up @@ -118,9 +113,7 @@ export type DevCredentials =
export type WrapperMiddleware = {
unwrap: WrapperUnwrapFunction;
wrap: WrapperWrapFunction;
getTextXPath: () => string;
testTextNode: (node: Text) => boolean;
getAttributeXPath: WrapperAttributeXPathGetter;
testAttribute: (node: Attr) => boolean;
};

Expand Down
8 changes: 0 additions & 8 deletions packages/web/src/observers/invisible/InvisibleWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ export function InvisibleWrapper({ fullKeyEncode }: Props): WrapperMiddleware {
return typeof value === 'string' ? value + invisibleMark : value;
},

getTextXPath() {
return `./descendant-or-self::text()[contains(., '${INVISIBLE_CHARACTERS[0]}${INVISIBLE_CHARACTERS[0]}') or contains(., '${INVISIBLE_CHARACTERS[1]}${INVISIBLE_CHARACTERS[0]}')]`;
},

testTextNode(textNode: Text) {
return (
(textNode.textContent?.includes(
Expand All @@ -114,10 +110,6 @@ export function InvisibleWrapper({ fullKeyEncode }: Props): WrapperMiddleware {
);
},

getAttributeXPath({ tag, attribute }) {
return `descendant-or-self::${tag}/@${attribute}[contains(., '${INVISIBLE_CHARACTERS[0]}${INVISIBLE_CHARACTERS[0]}') or contains(., '${INVISIBLE_CHARACTERS[1]}${INVISIBLE_CHARACTERS[0]}')]`;
},

testAttribute(attribute: Attr) {
return (
attribute.value.includes(
Expand Down
8 changes: 0 additions & 8 deletions packages/web/src/observers/text/TextWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ export function TextWrapper({
return { text: text, keys: [] };
},

getTextXPath() {
return `./descendant-or-self::text()[contains(., '${inputPrefix}') and contains(., '${inputSuffix}')]`;
},

testTextNode(textNode: Text) {
return (
(textNode.textContent?.includes(inputPrefix) &&
Expand All @@ -235,10 +231,6 @@ export function TextWrapper({
);
},

getAttributeXPath({ tag, attribute }) {
return `descendant-or-self::${tag}/@${attribute}[contains(., '${inputPrefix}') and contains(., '${inputSuffix}')]`;
},

testAttribute(attribute: Attr) {
return (
attribute.value.includes(inputPrefix) &&
Expand Down

0 comments on commit 6e99c33

Please sign in to comment.