@immense/vue-pom-generator 1.0.82 → 1.0.83
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.
- package/RELEASE_NOTES.md +31 -53
- package/dist/index.cjs +17 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +17 -15
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/runtime/annotator/client.d.ts +13 -0
- package/dist/plugin/runtime/annotator/client.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/format.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/plugin.d.ts +16 -0
- package/dist/plugin/runtime/annotator/plugin.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/text-utils.d.ts +15 -0
- package/dist/plugin/runtime/annotator/text-utils.d.ts.map +1 -0
- package/dist/plugin/runtime/annotator/vue-detector.d.ts +49 -0
- package/dist/plugin/runtime/annotator/vue-detector.d.ts.map +1 -1
- package/dist/pom-discoverability.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/runtime/annotator/client.ts +24 -12
- package/plugin/runtime/annotator/format.ts +5 -7
- package/plugin/runtime/annotator/plugin.ts +24 -6
- package/plugin/runtime/annotator/text-utils.ts +23 -0
- package/plugin/runtime/annotator/vue-detector.ts +56 -0
package/dist/index.mjs
CHANGED
|
@@ -561,14 +561,14 @@ function uniquePomStringPatterns(primary, alternates) {
|
|
|
561
561
|
}
|
|
562
562
|
return out;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function splitWords(value) {
|
|
565
565
|
const normalized = value.replace(/ByKey/g, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[._-]+/g, " ").trim();
|
|
566
566
|
if (!normalized) {
|
|
567
567
|
return [];
|
|
568
568
|
}
|
|
569
569
|
return normalized.split(/\s+/).map((word) => word.toLowerCase()).filter(Boolean);
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function joinWords(words) {
|
|
572
572
|
return words.join(" ").replace(/\s+/g, " ").trim();
|
|
573
573
|
}
|
|
574
574
|
function toSentenceCase(value) {
|
|
@@ -600,7 +600,7 @@ function removeTrailingRoleWord(words, roleWord) {
|
|
|
600
600
|
return words.slice(0, -1);
|
|
601
601
|
}
|
|
602
602
|
function humanizePomMethodName(methodName) {
|
|
603
|
-
return
|
|
603
|
+
return joinWords(splitWords(methodName));
|
|
604
604
|
}
|
|
605
605
|
function stripPomActionPrefix(actionName) {
|
|
606
606
|
for (const prefix of ["click", "select", "type", "goTo"]) {
|
|
@@ -617,13 +617,13 @@ function normalizePomRoleLabel(nativeRole) {
|
|
|
617
617
|
return nativeRole || "element";
|
|
618
618
|
}
|
|
619
619
|
function buildPomLocatorDescription(args) {
|
|
620
|
-
const componentWords =
|
|
620
|
+
const componentWords = splitWords(args.componentName ? stripComponentKindSuffix(args.componentName) : "");
|
|
621
621
|
const roleWord = normalizePomRoleLabel(args.nativeRole).toLowerCase();
|
|
622
622
|
const semanticWords = removeLeadingWords(
|
|
623
|
-
removeTrailingRoleWord(
|
|
623
|
+
removeTrailingRoleWord(splitWords(args.methodName), roleWord),
|
|
624
624
|
componentWords
|
|
625
625
|
);
|
|
626
|
-
const phrase =
|
|
626
|
+
const phrase = joinWords([
|
|
627
627
|
...componentWords,
|
|
628
628
|
...semanticWords,
|
|
629
629
|
roleWord
|
|
@@ -8866,8 +8866,11 @@ const DEFAULT_ENTRY_SUFFIXES = [
|
|
|
8866
8866
|
"/src/main.tsx",
|
|
8867
8867
|
"/src/main.jsx"
|
|
8868
8868
|
];
|
|
8869
|
+
function normalizePathSeparators(filePath) {
|
|
8870
|
+
return filePath.replace(/\\/g, "/");
|
|
8871
|
+
}
|
|
8869
8872
|
function toFsImportPath(filePath) {
|
|
8870
|
-
return `/@fs/${filePath
|
|
8873
|
+
return `/@fs/${normalizePathSeparators(filePath)}`;
|
|
8871
8874
|
}
|
|
8872
8875
|
function resolveAnnotatorClientPath() {
|
|
8873
8876
|
const candidates = [
|
|
@@ -8912,7 +8915,7 @@ function createAnnotatorUiPlugin(options) {
|
|
|
8912
8915
|
if (!options.enabled) {
|
|
8913
8916
|
return null;
|
|
8914
8917
|
}
|
|
8915
|
-
const normalizedId = id
|
|
8918
|
+
const normalizedId = normalizePathSeparators(id);
|
|
8916
8919
|
if (!DEFAULT_ENTRY_SUFFIXES.some((suffix) => normalizedId.endsWith(suffix))) {
|
|
8917
8920
|
return null;
|
|
8918
8921
|
}
|
|
@@ -10458,10 +10461,6 @@ const SHORTCUT_LABELS = {
|
|
|
10458
10461
|
settings: ",",
|
|
10459
10462
|
cancel: "Esc"
|
|
10460
10463
|
};
|
|
10461
|
-
function normalizeText(value) {
|
|
10462
|
-
const normalized = value?.replace(/\s+/g, " ").trim();
|
|
10463
|
-
return normalized || void 0;
|
|
10464
|
-
}
|
|
10465
10464
|
function formatShortcutTitle(label, shortcut) {
|
|
10466
10465
|
return shortcut ? `${label} (${shortcut})` : label;
|
|
10467
10466
|
}
|
|
@@ -10502,11 +10501,11 @@ function getElementPath(element) {
|
|
|
10502
10501
|
return segments.join(" > ");
|
|
10503
10502
|
}
|
|
10504
10503
|
function getNearbyText(element) {
|
|
10505
|
-
const ownText =
|
|
10504
|
+
const ownText = normalizeInlineText(element.textContent || void 0);
|
|
10506
10505
|
if (ownText && ownText.length >= 2) {
|
|
10507
10506
|
return ownText.length > 160 ? `${ownText.slice(0, 160)}...` : ownText;
|
|
10508
10507
|
}
|
|
10509
|
-
const parentText =
|
|
10508
|
+
const parentText = normalizeInlineText(element.parentElement?.textContent || void 0);
|
|
10510
10509
|
if (parentText) {
|
|
10511
10510
|
return parentText.length > 160 ? `${parentText.slice(0, 160)}...` : parentText;
|
|
10512
10511
|
}
|
|
@@ -10529,6 +10528,9 @@ function createFloatingArrow() {
|
|
|
10529
10528
|
function toCssPixels(value) {
|
|
10530
10529
|
return `${Math.round(value)}px`;
|
|
10531
10530
|
}
|
|
10531
|
+
function placementPrimarySide(placement) {
|
|
10532
|
+
return placement.split("-")[0];
|
|
10533
|
+
}
|
|
10532
10534
|
function clamp(value, min, max) {
|
|
10533
10535
|
return Math.min(Math.max(value, min), max);
|
|
10534
10536
|
}
|
|
@@ -11017,7 +11019,7 @@ class AnnotatorRuntime {
|
|
|
11017
11019
|
panel.style.top = toCssPixels(result.y);
|
|
11018
11020
|
panel.style.visibility = "visible";
|
|
11019
11021
|
const arrowData = result.middlewareData.arrow;
|
|
11020
|
-
const side = result.placement
|
|
11022
|
+
const side = placementPrimarySide(result.placement);
|
|
11021
11023
|
const staticSide = side === "top" ? "bottom" : side === "bottom" ? "top" : side === "left" ? "right" : "left";
|
|
11022
11024
|
arrowEl.style.removeProperty("top");
|
|
11023
11025
|
arrowEl.style.removeProperty("right");
|