@septkit/ui 0.0.81 → 0.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.
Files changed (81) hide show
  1. package/dist/dialecte/create-document-store.js +4 -4
  2. package/dist/external/.pnpm/{@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/dialecte-oAXwOG-Q.js → @dialecte_core@0.10.0/node_modules/@dialecte/core/dist/dialecte-CVLWSkgW.js} +1 -1
  3. package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +130 -0
  4. package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/index.js +6 -0
  5. package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/project-key-2ccZ-0gu.js +1 -1
  6. package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
  7. package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/running-operations-DCKvzlU7.js +1 -1
  8. package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/same-json-value-_AChwM_n.js +1 -1
  9. package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +79 -102
  10. package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/utils.js +2 -0
  11. package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +59 -117
  12. package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +57 -60
  13. package/dist/index.d.ts +49 -1960
  14. package/dist/index.js +19 -27
  15. package/dist/selector-input/index.js +3 -3
  16. package/dist/selector-input/selector-input.js +4 -89
  17. package/dist/selector-input/selector-input.vue_vue_type_script_setup_true_lang.js +91 -89
  18. package/dist/selector-input/selector-xpath.js +92 -0
  19. package/dist/ui.css +1 -1
  20. package/package.json +3 -3
  21. package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -179
  22. package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers.js +0 -3
  23. package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/index.js +0 -6
  24. package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/utils.js +0 -2
  25. package/dist/external/.pnpm/@dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/declaration.constants-DSLNk1wh.js +0 -45065
  26. package/dist/external/.pnpm/@dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
  27. package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/arrow-right.js +0 -11
  28. package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/list-tree.js +0 -26
  29. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperIndicator.js +0 -27
  30. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperItem.js +0 -67
  31. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperRoot.js +0 -136
  32. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTitle.js +0 -28
  33. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTrigger.js +0 -97
  34. package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js +0 -31
  35. package/dist/merge/check-files/components/merge-preflight.js +0 -5
  36. package/dist/merge/check-files/components/merge-preflight.vue_vue_type_script_setup_true_lang.js +0 -53
  37. package/dist/merge/check-files/flags.js +0 -17
  38. package/dist/merge/check-files/identity-warning.js +0 -19
  39. package/dist/merge/confirm/components/merge-summary.js +0 -5
  40. package/dist/merge/confirm/components/merge-summary.vue_vue_type_script_setup_true_lang.js +0 -207
  41. package/dist/merge/confirm/landings.js +0 -34
  42. package/dist/merge/confirm/outcome.js +0 -179
  43. package/dist/merge/confirm/summary.js +0 -57
  44. package/dist/merge/done/applied-counts.js +0 -16
  45. package/dist/merge/done/applied-focus.js +0 -15
  46. package/dist/merge/help.js +0 -76
  47. package/dist/merge/index.js +0 -8
  48. package/dist/merge/match/components/merge-map.js +0 -5
  49. package/dist/merge/match/components/merge-map.vue_vue_type_script_setup_true_lang.js +0 -230
  50. package/dist/merge/match/match.js +0 -210
  51. package/dist/merge/review/affix.js +0 -14
  52. package/dist/merge/review/change-badge.js +0 -10
  53. package/dist/merge/review/components/decision-toggle.js +0 -5
  54. package/dist/merge/review/components/decision-toggle.vue_vue_type_script_setup_true_lang.js +0 -80
  55. package/dist/merge/review/components/element-detail.js +0 -5
  56. package/dist/merge/review/components/element-detail.vue_vue_type_script_setup_true_lang.js +0 -210
  57. package/dist/merge/review/components/merge-tree.js +0 -5
  58. package/dist/merge/review/components/merge-tree.vue_vue_type_script_setup_true_lang.js +0 -192
  59. package/dist/merge/review/components/type-name-authority.js +0 -5
  60. package/dist/merge/review/components/type-name-authority.vue_vue_type_script_setup_true_lang.js +0 -47
  61. package/dist/merge/review/decision.js +0 -12
  62. package/dist/merge/review/detail.js +0 -63
  63. package/dist/merge/review/highlight.js +0 -44
  64. package/dist/merge/review/marks.js +0 -17
  65. package/dist/merge/review/navigation.js +0 -82
  66. package/dist/merge/review/title.js +0 -7
  67. package/dist/merge/review/tree.js +0 -138
  68. package/dist/merge/session/components/merge-help.js +0 -7
  69. package/dist/merge/session/components/merge-help.vue_vue_type_script_setup_true_lang.js +0 -109
  70. package/dist/merge/session/components/merge-progress.js +0 -5
  71. package/dist/merge/session/components/merge-progress.vue_vue_type_script_setup_true_lang.js +0 -23
  72. package/dist/merge/session/components/merge-review.js +0 -5
  73. package/dist/merge/session/components/merge-review.vue_vue_type_script_setup_true_lang.js +0 -895
  74. package/dist/merge/session/merge.service.js +0 -113
  75. package/dist/merge/session/shortcuts.js +0 -22
  76. package/dist/merge/session/staged-writes.js +0 -47
  77. package/dist/merge/session/steps.js +0 -21
  78. package/dist/merge/session/use-document-progress.js +0 -26
  79. package/dist/merge/session/use-merge-session.js +0 -372
  80. package/dist/merge/wording.js +0 -123
  81. package/dist/selector-input/selector-input2.js +0 -5
package/dist/index.js CHANGED
@@ -38,35 +38,27 @@ import { NOTE_CATEGORIES as M, NOTE_CATEGORY_LABELS as N, NOTE_STATUSES as P, pa
38
38
  import L from "./notes/note-category-tag.js";
39
39
  import R from "./notes/note-category-picker.js";
40
40
  import "./notes/index.js";
41
- import z from "./merge/review/components/decision-toggle.js";
42
- import B from "./merge/review/components/element-detail.js";
43
- import V from "./merge/match/components/merge-map.js";
44
- import H from "./merge/review/components/merge-tree.js";
45
- import U from "./merge/review/components/type-name-authority.js";
46
- import { useMergeSession as W } from "./merge/session/use-merge-session.js";
47
- import G from "./merge/session/components/merge-review.js";
48
- import "./merge/index.js";
49
- import { KEY_SEPARATOR as K, NO_VALUE_KEY as q, buildFlatOptions as J, buildMultiValueOptions as Y, buildTreeOptions as X, collectLeafKeys as Z, collectParentKeys as Q, filterTree as $ } from "./table/filters/build-filter-options.js";
50
- import { useColumnFilters as ee } from "./table/filters/use-column-filters.js";
51
- import { useRowSort as te } from "./table/filters/use-row-sort.js";
52
- import { provideColumnFilterHeader as ne, useColumnFilterHeaderContext as re } from "./table/column-filter-context.js";
53
- import { provideRowSortHeader as ie, useOptionalRowSortContext as ae } from "./table/row-sort-context.js";
54
- import oe from "./table/filterable-column-header.js";
41
+ import { KEY_SEPARATOR as z, NO_VALUE_KEY as B, buildFlatOptions as V, buildMultiValueOptions as H, buildTreeOptions as U, collectLeafKeys as W, collectParentKeys as G, filterTree as K } from "./table/filters/build-filter-options.js";
42
+ import { useColumnFilters as q } from "./table/filters/use-column-filters.js";
43
+ import { useRowSort as J } from "./table/filters/use-row-sort.js";
44
+ import { provideColumnFilterHeader as Y, useColumnFilterHeaderContext as X } from "./table/column-filter-context.js";
45
+ import { provideRowSortHeader as Z, useOptionalRowSortContext as Q } from "./table/row-sort-context.js";
46
+ import $ from "./table/filterable-column-header.js";
55
47
  import "./table/index.js";
56
- import se from "./context-menu/context-menu.js";
48
+ import ee from "./context-menu/context-menu.js";
57
49
  import "./context-menu/index.js";
58
- import { buildXpath as ce, matchName as le, parseXpath as ue, validateXpath as de } from "./selector-input/selector-input.js";
59
- import fe from "./selector-input/selector-input2.js";
50
+ import { buildXpath as te, matchName as ne, parseXpath as re, validateSearchText as ie, validateXpath as ae } from "./selector-input/selector-xpath.js";
51
+ import oe from "./selector-input/selector-input.js";
60
52
  import "./selector-input/index.js";
61
- import pe from "./split-layout/split-layout.js";
53
+ import se from "./split-layout/split-layout.js";
62
54
  import "./split-layout/index.js";
63
- import { applyInitialVisibility as me, buildRecordCache as he, collectVisibleIds as ge, hideDescendants as _e } from "./diagram-layout/visibility-model.js";
64
- import { groupStackMetrics as ve } from "./diagram-layout/group-stack.js";
65
- import { GROUP_COLLAPSED_MEMBERS_HEIGHT as ye, GROUP_HEADER_HEIGHT as be, GROUP_MEMBER_GAP as xe, GROUP_MEMBER_HEIGHT as Se, GROUP_MEMBER_HEIGHT_COMPACT as Ce, memberCardHeight as we } from "./diagram-layout/group-geometry.js";
66
- import { computeGroups as Te, isGroupId as Ee, makeGroupId as De } from "./diagram-layout/grouping.js";
67
- import { createElkLayoutEngine as Oe } from "./diagram-layout/elk-layout-engine.js";
68
- import { useDiagramLayout as ke } from "./diagram-layout/use-diagram-layout.js";
69
- import Ae from "./diagram-layout/diagram-node-card.js";
70
- import je from "./diagram-layout/diagram-node-group.js";
55
+ import { applyInitialVisibility as ce, buildRecordCache as le, collectVisibleIds as ue, hideDescendants as de } from "./diagram-layout/visibility-model.js";
56
+ import { groupStackMetrics as fe } from "./diagram-layout/group-stack.js";
57
+ import { GROUP_COLLAPSED_MEMBERS_HEIGHT as pe, GROUP_HEADER_HEIGHT as me, GROUP_MEMBER_GAP as he, GROUP_MEMBER_HEIGHT as ge, GROUP_MEMBER_HEIGHT_COMPACT as _e, memberCardHeight as ve } from "./diagram-layout/group-geometry.js";
58
+ import { computeGroups as ye, isGroupId as be, makeGroupId as xe } from "./diagram-layout/grouping.js";
59
+ import { createElkLayoutEngine as Se } from "./diagram-layout/elk-layout-engine.js";
60
+ import { useDiagramLayout as Ce } from "./diagram-layout/use-diagram-layout.js";
61
+ import we from "./diagram-layout/diagram-node-card.js";
62
+ import Te from "./diagram-layout/diagram-node-group.js";
71
63
  import "./diagram-layout/index.js";
72
- export { s as Button, x as CATEGORY_ELEMENTS, k as CodeBlock, l as Combobox, se as ContextMenu, z as DecisionToggle, Ae as DiagramNodeCard, je as DiagramNodeGroup, p as Dialog, y as DialogHost, b as DocumentProgressBar, c as Dropdown, S as ELEMENT_TO_COLOR, C as ELEMENT_TO_ICON, w as ElementBadge, B as ElementDetail, m as FeedbackDialog, oe as FilterableColumnHeader, u as FloatingTooltip, ye as GROUP_COLLAPSED_MEMBERS_HEIGHT, be as GROUP_HEADER_HEIGHT, xe as GROUP_MEMBER_GAP, Se as GROUP_MEMBER_HEIGHT, Ce as GROUP_MEMBER_HEIGHT_COMPACT, K as KEY_SEPARATOR, D as LibraryBrowser, V as MergeMap, G as MergeReview, H as MergeTree, d as MultiSelect, M as NOTE_CATEGORIES, N as NOTE_CATEGORY_LABELS, P as NOTE_STATUSES, q as NO_VALUE_KEY, R as NoteCategoryPicker, L as NoteCategoryTag, E as SclExplorer, fe as SelectorInput, pe as SplitLayout, f as TextInputAutocomplete, U as TypeNameAuthority, j as XmlDiff, me as applyInitialVisibility, J as buildFlatOptions, Y as buildMultiValueOptions, he as buildRecordCache, X as buildTreeOptions, ce as buildXpath, T as collectExpandableNodeIds, Z as collectLeafKeys, Q as collectParentKeys, ge as collectVisibleIds, Te as computeGroups, h as createDialogHost, e as createDocumentStore, Oe as createElkLayoutEngine, g as dialogHostKey, A as diffLines, $ as filterTree, ve as groupStackMetrics, _e as hideDescendants, O as highlightCode, Ee as isGroupId, De as makeGroupId, le as matchName, we as memberCardHeight, F as parseNoteData, ue as parseXpath, ne as provideColumnFilterHeader, _ as provideDialogHost, ie as provideRowSortHeader, I as serializeNoteData, i as useActiveDocument, re as useColumnFilterHeaderContext, ee as useColumnFilters, ke as useDiagramLayout, t as useDialecteChannel, v as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, W as useMergeSession, ae as useOptionalRowSortContext, r as useProjectLiveData, te as useRowSort, de as validateXpath };
64
+ export { s as Button, x as CATEGORY_ELEMENTS, k as CodeBlock, l as Combobox, ee as ContextMenu, we as DiagramNodeCard, Te as DiagramNodeGroup, p as Dialog, y as DialogHost, b as DocumentProgressBar, c as Dropdown, S as ELEMENT_TO_COLOR, C as ELEMENT_TO_ICON, w as ElementBadge, m as FeedbackDialog, $ as FilterableColumnHeader, u as FloatingTooltip, pe as GROUP_COLLAPSED_MEMBERS_HEIGHT, me as GROUP_HEADER_HEIGHT, he as GROUP_MEMBER_GAP, ge as GROUP_MEMBER_HEIGHT, _e as GROUP_MEMBER_HEIGHT_COMPACT, z as KEY_SEPARATOR, D as LibraryBrowser, d as MultiSelect, M as NOTE_CATEGORIES, N as NOTE_CATEGORY_LABELS, P as NOTE_STATUSES, B as NO_VALUE_KEY, R as NoteCategoryPicker, L as NoteCategoryTag, E as SclExplorer, oe as SelectorInput, se as SplitLayout, f as TextInputAutocomplete, j as XmlDiff, ce as applyInitialVisibility, V as buildFlatOptions, H as buildMultiValueOptions, le as buildRecordCache, U as buildTreeOptions, te as buildXpath, T as collectExpandableNodeIds, W as collectLeafKeys, G as collectParentKeys, ue as collectVisibleIds, ye as computeGroups, h as createDialogHost, e as createDocumentStore, Se as createElkLayoutEngine, g as dialogHostKey, A as diffLines, K as filterTree, fe as groupStackMetrics, de as hideDescendants, O as highlightCode, be as isGroupId, xe as makeGroupId, ne as matchName, ve as memberCardHeight, F as parseNoteData, re as parseXpath, Y as provideColumnFilterHeader, _ as provideDialogHost, Z as provideRowSortHeader, I as serializeNoteData, i as useActiveDocument, X as useColumnFilterHeaderContext, q as useColumnFilters, Ce as useDiagramLayout, t as useDialecteChannel, v as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, Q as useOptionalRowSortContext, r as useProjectLiveData, J as useRowSort, ie as validateSearchText, ae as validateXpath };
@@ -1,3 +1,3 @@
1
- import { buildXpath as e, matchName as t, parseXpath as n, validateXpath as r } from "./selector-input.js";
2
- import i from "./selector-input2.js";
3
- export { i as SelectorInput, e as buildXpath, t as matchName, n as parseXpath, r as validateXpath };
1
+ import { buildXpath as e, matchName as t, parseXpath as n, validateSearchText as r, validateXpath as i } from "./selector-xpath.js";
2
+ import a from "./selector-input.js";
3
+ export { a as SelectorInput, e as buildXpath, t as matchName, n as parseXpath, r as validateSearchText, i as validateXpath };
@@ -1,90 +1,5 @@
1
- //#region lib/selector-input/selector-input.ts
2
- var e = "[\\w.-]+", t = RegExp(`^${e}$`), n = "(?:'[^']*'|\"[^\"]*\")", r = `ancestor::\\*\\[local-name\\(\\)='(${e})'\\]\\[1\\]`, i = `local-name\\(\\)='${e}'`, a = `${i}(?: or ${i})*`, o = (e) => `(?:@name=${e(n)}|${e("starts-with|contains")}\\(@name,${e(n)}\\)|substring\\(@name,string-length\\(@name\\)-string-length\\(${e(n)}\\)\\+1\\)=${e(n)})`, s = RegExp(`^${o((e) => `(${e})`)}$`), c = o((e) => `(?:${e})`), l = RegExp(`^(?:${r})?//\\*(?:\\[(${a})\\])?(?:\\[(${c})\\]|\\[ancestor::\\*\\[(${a})\\]\\[1\\]\\[(${c})\\]\\])?$`);
3
- function u({ anchor: e, targets: t, nameFilter: n, nameOwners: r = [] }) {
4
- b(e, { optional: !0 }), t.forEach((e) => b(e)), r.forEach((e) => b(e));
5
- let i = n?.value ? n : void 0;
6
- if (!e && t.length === 0 && !i) return "";
7
- let a = e ? `ancestor::*[local-name()='${e}'][1]` : "", o = i ? h(i) : "", s = i && r.length > 0 ? `[ancestor::*[${p(r)}][1][${o}]]` : i ? `[${o}]` : "";
8
- return `${a}//*${t.length > 0 ? `[${p(t)}]` : ""}${s}`;
9
- }
10
- function d(e) {
11
- let t = l.exec(e);
12
- if (!t) return;
13
- let [, n = "", r = "", i, a, o] = t, s = i ?? o, c = s ? g(s) : void 0;
14
- if (c === null || !n && !r && !c) return;
15
- let u = m(r);
16
- return c ? a ? {
17
- anchor: n,
18
- targets: u,
19
- nameFilter: c,
20
- nameOwners: m(a)
21
- } : {
22
- anchor: n,
23
- targets: u,
24
- nameFilter: c
25
- } : {
26
- anchor: n,
27
- targets: u
28
- };
29
- }
30
- function f({ match: e, value: t }, n) {
31
- if (n === void 0) return !1;
32
- switch (e) {
33
- case "equals": return n === t;
34
- case "starts-with": return n.startsWith(t);
35
- case "ends-with": return n.endsWith(t);
36
- case "contains": return n.includes(t);
37
- }
38
- }
39
- function p(e) {
40
- return e.map((e) => `local-name()='${e}'`).join(" or ");
41
- }
42
- function m(e) {
43
- return [...e.matchAll(/local-name\(\)='([^']+)'/g)].map((e) => e[1]);
44
- }
45
- function h({ match: e, value: t }) {
46
- let n = _(t);
47
- switch (e) {
48
- case "equals": return `@name=${n}`;
49
- case "starts-with":
50
- case "contains": return `${e}(@name,${n})`;
51
- case "ends-with": return `substring(@name,string-length(@name)-string-length(${n})+1)=${n}`;
52
- }
53
- }
54
- function g(e) {
55
- let t = s.exec(e);
56
- if (!t) return null;
57
- let [, n, r, i, a, o] = t;
58
- return n ? {
59
- match: "equals",
60
- value: v(n)
61
- } : r && i ? {
62
- match: r,
63
- value: v(i)
64
- } : a === o ? {
65
- match: "ends-with",
66
- value: v(a)
67
- } : null;
68
- }
69
- function _(e) {
70
- if (!e.includes("'")) return `'${e}'`;
71
- if (!e.includes("\"")) return `"${e}"`;
72
- throw Error("Search text must not contain both single and double quotes");
73
- }
74
- function v(e) {
75
- return e.slice(1, -1);
76
- }
77
- function y(e) {
78
- if (e.trim() !== "") try {
79
- let t = document.implementation.createDocument(null, "root");
80
- t.evaluate(e, t, null, XPathResult.ANY_TYPE, null);
81
- return;
82
- } catch (e) {
83
- return e instanceof Error && e.message || "Invalid XPath";
84
- }
85
- }
86
- function b(e, { optional: n = !1 } = {}) {
87
- if (!(n && e === "") && !t.test(e)) throw Error(`Invalid element name "${e}"`);
88
- }
1
+ import e from "./selector-input.vue_vue_type_script_setup_true_lang.js";
2
+ //#region lib/selector-input/selector-input.vue
3
+ var t = e;
89
4
  //#endregion
90
- export { u as buildXpath, f as matchName, d as parseXpath, y as validateXpath };
5
+ export { t as default };
@@ -1,58 +1,57 @@
1
- import { buildXpath as e, parseXpath as t, validateXpath as n } from "./selector-input.js";
2
- import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, renderSlot as h, toDisplayString as g, useModel as _, vModelText as v, watch as y, withDirectives as b } from "vue";
1
+ import { buildXpath as e, parseXpath as t, validateSearchText as n, validateXpath as r } from "./selector-xpath.js";
2
+ import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, onBeforeUnmount as f, openBlock as p, reactive as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, useModel as y, vModelText as b, watch as x, withDirectives as S } from "vue";
3
3
  //#region lib/selector-input/selector-input.vue?vue&type=script&setup=true&lang.ts
4
- var x = {
4
+ var C = {
5
5
  class: "flex flex-col gap-2",
6
6
  "data-testid": "selector-input"
7
- }, S = { class: "tabs tabs-box w-fit tabs-sm" }, C = {
7
+ }, w = { class: "tabs tabs-box w-fit tabs-sm" }, T = ["data-testid", "onClick"], E = {
8
8
  key: 0,
9
9
  role: "status",
10
10
  class: "alert alert-soft alert-info py-2 text-sm",
11
11
  "data-testid": "selector-input-custom-hint"
12
- }, w = { class: "fieldset" }, T = { class: "flex flex-wrap gap-2" }, E = [
12
+ }, D = { class: "fieldset" }, O = { class: "flex flex-wrap gap-2" }, k = [
13
13
  "aria-pressed",
14
14
  "data-testid",
15
15
  "onClick"
16
- ], D = {
16
+ ], A = {
17
17
  key: 1,
18
18
  class: "fieldset"
19
- }, O = { class: "fieldset-legend text-sm font-medium" }, k = {
19
+ }, j = { class: "fieldset-legend text-sm font-medium" }, M = {
20
20
  class: "join",
21
21
  role: "group",
22
22
  "aria-label": "Name match"
23
- }, A = [
23
+ }, N = [
24
24
  "aria-pressed",
25
25
  "data-testid",
26
26
  "onClick"
27
- ], ee = [
27
+ ], P = [
28
28
  "value",
29
29
  "aria-label",
30
30
  "placeholder"
31
- ], j = {
32
- key: 0,
33
- class: "label text-error",
34
- role: "alert",
35
- "data-testid": "selector-input-search-error"
36
- }, M = {
31
+ ], F = {
37
32
  key: 1,
38
33
  class: "fieldset"
39
- }, N = ["disabled"], P = {
34
+ }, I = ["disabled"], L = {
40
35
  key: 0,
41
36
  class: "label text-error",
42
37
  role: "alert",
43
38
  "data-testid": "selector-input-error"
44
- }, F = {
45
- key: 1,
39
+ }, R = {
40
+ key: 2,
46
41
  class: "label text-error",
47
42
  role: "alert",
48
43
  "data-testid": "selector-input-search-error"
49
- }, I = /*@__PURE__*/ c({
44
+ }, z = /*@__PURE__*/ l({
50
45
  __name: "selector-input",
51
- props: /*@__PURE__*/ l({
46
+ props: /*@__PURE__*/ u({
52
47
  anchors: {},
53
48
  anywhereLabel: { default: "Anywhere" },
54
49
  targets: { default: () => [] },
55
- nameOwners: { default: () => [] },
50
+ nameParent: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ nameLabel: { default: "Name" },
56
55
  searchable: {
57
56
  type: Boolean,
58
57
  default: !0
@@ -71,8 +70,14 @@ var x = {
71
70
  invalidModifiers: {}
72
71
  }),
73
72
  emits: ["update:modelValue", "update:invalid"],
74
- setup(c) {
75
- let l = [
73
+ setup(l) {
74
+ let u = l, z = y(l, "modelValue"), B = y(l, "invalid"), V = [{
75
+ value: "builder",
76
+ label: "Builder"
77
+ }, {
78
+ value: "xpath",
79
+ label: "XPath"
80
+ }], H = [
76
81
  {
77
82
  value: "equals",
78
83
  label: "Full name"
@@ -89,92 +94,89 @@ var x = {
89
94
  value: "contains",
90
95
  label: "Contains"
91
96
  }
92
- ], I = c, L = _(c, "modelValue"), R = _(c, "invalid"), z = i(() => t(L.value)), B = p(z.value?.anchor ?? ""), V = p(z.value?.targets ?? I.targets), H = p(z.value?.nameFilter?.match ?? "contains"), U = p(z.value?.nameFilter?.value ?? ""), W = p("builder"), G = i(() => L.value !== "" && z.value === void 0), K = i(() => I.allowXpath ? n(L.value) : void 0), q = i(() => I.nameOwners.length > 0 ? "Search by function name" : "Search by name"), J = i(() => U.value.includes("'") && U.value.includes("\"") ? "Search text must not contain both single and double quotes" : void 0), Y = i(() => !!(J.value || K.value)), X = i(() => [{
93
- value: "",
94
- label: I.anywhereLabel
95
- }, ...I.anchors]);
96
- y(Y, (e) => R.value = e, { immediate: !0 }), d(() => R.value = !1), y(L, (e) => {
97
- let n = t(e);
98
- B.value = n?.anchor ?? "", V.value = n?.targets ?? I.targets, U.value = n?.nameFilter?.value ?? "", n?.nameFilter && (H.value = n.nameFilter.match);
97
+ ], U = h("builder"), W = m({
98
+ anchor: "",
99
+ match: "contains",
100
+ search: ""
99
101
  });
100
- function Z(e) {
101
- B.value = e, $();
102
- }
102
+ Q(z.value), x(z, Q);
103
+ let G = a(() => t(z.value)), K = a(() => z.value !== "" && G.value === void 0), q = a(() => u.allowXpath ? r(z.value) : void 0), J = a(() => n(W.search)), Y = a(() => [{
104
+ value: "",
105
+ label: u.anywhereLabel
106
+ }, ...u.anchors]), X = a(() => `Search by ${u.nameLabel.toLowerCase()}`), Z = a(() => `A custom XPath is in use. Choosing a scope${u.searchable ? " or entering a search" : ""} replaces it.`);
107
+ x(() => !!(J.value || q.value), (e) => B.value = e, { immediate: !0 }), f(() => B.value = !1);
103
108
  function Q(e) {
104
- H.value = e, $();
105
- }
106
- function te(e) {
107
- U.value = e, $();
109
+ let n = t(e);
110
+ if (W.anchor = n?.anchor ?? "", n?.nameFilter) {
111
+ W.search = n.nameFilter.value, W.match = n.nameFilter.match;
112
+ return;
113
+ }
114
+ W.search && (W.search = "", W.match = "contains");
108
115
  }
109
- function $() {
110
- J.value || (L.value = e({
111
- anchor: B.value,
112
- targets: V.value,
116
+ function $(t) {
117
+ Object.assign(W, t), !J.value && (z.value = e({
118
+ anchor: W.anchor,
119
+ targets: G.value?.targets ?? u.targets,
113
120
  nameFilter: {
114
- match: H.value,
115
- value: U.value
121
+ match: W.match,
122
+ value: W.search
116
123
  },
117
- nameOwners: I.nameOwners
124
+ nameParent: G.value?.nameParent ?? u.nameParent
118
125
  }));
119
126
  }
120
- return (e, t) => (f(), o("div", x, [
121
- s("div", S, [s("button", {
122
- type: "button",
123
- class: u(["tab", { "tab-active": W.value === "builder" }]),
124
- "data-testid": "selector-input-mode-builder",
125
- onClick: t[0] ||= (e) => W.value = "builder"
126
- }, " Builder ", 2), s("button", {
127
+ return (e, t) => (p(), s("div", C, [
128
+ c("div", w, [(p(), s(i, null, g(V, (e) => c("button", {
129
+ key: e.value,
127
130
  type: "button",
128
- class: u(["tab", { "tab-active": W.value === "xpath" }]),
129
- "data-testid": "selector-input-mode-xpath",
130
- onClick: t[1] ||= (e) => W.value = "xpath"
131
- }, " XPath ", 2)]),
132
- W.value === "builder" ? (f(), o(r, { key: 0 }, [
133
- G.value ? (f(), o("div", C, g(c.searchable ? "A custom XPath is in use. Choosing a scope or entering a search replaces it." : "A custom XPath is in use. Choosing a scope replaces it."), 1)) : a("", !0),
134
- s("fieldset", w, [t[4] ||= s("legend", { class: "fieldset-legend text-sm font-medium" }, "Scope", -1), s("div", T, [(f(!0), o(r, null, m(X.value, (e) => (f(), o("button", {
131
+ class: d(["tab", { "tab-active": U.value === e.value }]),
132
+ "data-testid": `selector-input-mode-${e.value}`,
133
+ onClick: (t) => U.value = e.value
134
+ }, v(e.label), 11, T)), 64))]),
135
+ U.value === "builder" ? (p(), s(i, { key: 0 }, [
136
+ K.value ? (p(), s("div", E, v(Z.value), 1)) : o("", !0),
137
+ c("fieldset", D, [t[2] ||= c("legend", { class: "fieldset-legend text-sm font-medium" }, "Scope", -1), c("div", O, [(p(!0), s(i, null, g(Y.value, (e) => (p(), s("button", {
135
138
  key: e.value,
136
139
  type: "button",
137
- class: u(["badge badge-sm cursor-pointer", !G.value && B.value === e.value ? "badge-primary" : "badge-soft"]),
138
- "aria-pressed": !G.value && B.value === e.value,
140
+ class: d(["badge badge-sm cursor-pointer", !K.value && W.anchor === e.value ? "badge-primary" : "badge-soft"]),
141
+ "aria-pressed": !K.value && W.anchor === e.value,
139
142
  "data-testid": `selector-input-anchor-${e.value || "none"}`,
140
- onClick: (t) => Z(e.value)
141
- }, g(e.label), 11, E))), 128))])]),
142
- c.searchable ? (f(), o("fieldset", D, [
143
- s("legend", O, g(c.nameOwners.length > 0 ? "Function name" : "Name"), 1),
144
- s("div", k, [(f(), o(r, null, m(l, (e) => s("button", {
143
+ onClick: (t) => $({ anchor: e.value })
144
+ }, v(e.label), 11, k))), 128))])]),
145
+ l.searchable ? (p(), s("fieldset", A, [
146
+ c("legend", j, v(l.nameLabel), 1),
147
+ c("div", M, [(p(), s(i, null, g(H, (e) => c("button", {
145
148
  key: e.value,
146
149
  type: "button",
147
- class: u(["btn btn-sm join-item", { "btn-primary": H.value === e.value }]),
148
- "aria-pressed": H.value === e.value,
150
+ class: d(["btn btn-sm join-item", { "btn-primary": W.match === e.value }]),
151
+ "aria-pressed": W.match === e.value,
149
152
  "data-testid": `selector-input-match-${e.value}`,
150
- onClick: (t) => Q(e.value)
151
- }, g(e.label), 11, A)), 64))]),
152
- s("input", {
153
- value: U.value,
153
+ onClick: (t) => $({ match: e.value })
154
+ }, v(e.label), 11, N)), 64))]),
155
+ c("input", {
156
+ value: W.search,
154
157
  type: "search",
155
- "aria-label": q.value,
156
- class: u(["input input-sm w-full", { "input-error": J.value }]),
157
- placeholder: q.value,
158
+ "aria-label": X.value,
159
+ class: d(["input input-sm w-full", { "input-error": J.value }]),
160
+ placeholder: X.value,
158
161
  "data-testid": "selector-input-search",
159
- onInput: t[2] ||= (e) => te(e.target.value)
160
- }, null, 42, ee),
161
- J.value ? (f(), o("p", j, g(J.value), 1)) : a("", !0)
162
- ])) : a("", !0)
163
- ], 64)) : (f(), o("fieldset", M, [
164
- t[5] ||= s("legend", { class: "fieldset-legend" }, "XPath", -1),
165
- b(s("input", {
166
- "onUpdate:modelValue": t[3] ||= (e) => L.value = e,
162
+ onInput: t[0] ||= (e) => $({ search: e.target.value })
163
+ }, null, 42, P)
164
+ ])) : o("", !0)
165
+ ], 64)) : (p(), s("fieldset", F, [
166
+ t[3] ||= c("legend", { class: "fieldset-legend" }, "XPath", -1),
167
+ S(c("input", {
168
+ "onUpdate:modelValue": t[1] ||= (e) => z.value = e,
167
169
  type: "text",
168
- disabled: !c.allowXpath,
169
- class: u(["input w-full font-mono", { "input-error": K.value }]),
170
+ disabled: !l.allowXpath,
171
+ class: d(["input w-full font-mono", { "input-error": q.value }]),
170
172
  "data-testid": "selector-input-raw"
171
- }, null, 10, N), [[v, L.value]]),
172
- K.value ? (f(), o("p", P, g(K.value), 1)) : a("", !0),
173
- J.value ? (f(), o("p", F, g(J.value), 1)) : a("", !0)
173
+ }, null, 10, I), [[b, z.value]]),
174
+ q.value ? (p(), s("p", L, v(q.value), 1)) : o("", !0)
174
175
  ])),
175
- h(e.$slots, "footer")
176
+ J.value ? (p(), s("p", R, v(J.value), 1)) : o("", !0),
177
+ _(e.$slots, "footer")
176
178
  ]));
177
179
  }
178
180
  });
179
181
  //#endregion
180
- export { I as default };
182
+ export { z as default };
@@ -0,0 +1,92 @@
1
+ //#region lib/selector-input/selector-xpath.ts
2
+ var e = "Search text must not contain both single and double quotes", t = "[\\w.-]+", n = RegExp(`^${t}$`), r = "(?:'[^']*'|\"[^\"]*\")", i = `local-name\\(\\)='${t}'`, a = `${i}(?: or ${i})*`, o = `(?:@name=(${r})|(starts-with|contains)\\(@name,(${r})\\)|substring\\(@name,string-length\\(@name\\)-string-length\\((${r})\\)\\+1\\)=(${r}))`, s = RegExp(`^${o}$`), c = RegExp(`^(?:ancestor::\\*\\[local-name\\(\\)='(?<anchor>${t})'\\]\\[1\\])?//\\*(?:\\[(?<targets>${a})\\])?(?:\\[(?<ownName>${o})\\]|\\[ancestor::\\*\\[${a}\\]\\[1\\]\\[(?<ownerName>${o})\\]\\]|\\[parent::\\*\\[(?<parentName>${o})\\]\\])?$`);
3
+ function l({ anchor: e, targets: t, nameFilter: n, nameParent: r = !1 }) {
4
+ e && x(e), t.forEach(x);
5
+ let i = n?.value ? n : void 0;
6
+ return !e && t.length === 0 && !i ? "" : `${e ? `ancestor::*[local-name()='${e}'][1]` : ""}//*${t.length > 0 ? `[${m(t)}]` : ""}${i ? h(i, r) : ""}`;
7
+ }
8
+ function u(e) {
9
+ let t = c.exec(e)?.groups;
10
+ if (!t) return;
11
+ let { anchor: n = "", targets: r = "", ownName: i, ownerName: a, parentName: o } = t, s = i ?? a ?? o, l = s ? v(s) : void 0;
12
+ if (s && !l || !n && !r && !l) return;
13
+ let u = {
14
+ anchor: n,
15
+ targets: _(r)
16
+ };
17
+ return l ? i ? {
18
+ ...u,
19
+ nameFilter: l
20
+ } : {
21
+ ...u,
22
+ nameFilter: l,
23
+ nameParent: !0
24
+ } : u;
25
+ }
26
+ function d({ match: e, value: t }, n) {
27
+ if (n === void 0) return !1;
28
+ switch (e) {
29
+ case "equals": return n === t;
30
+ case "starts-with": return n.startsWith(t);
31
+ case "ends-with": return n.endsWith(t);
32
+ case "contains": return n.includes(t);
33
+ }
34
+ }
35
+ function f(e) {
36
+ if (e.trim() !== "") try {
37
+ let t = document.implementation.createDocument(null, "root");
38
+ t.evaluate(e, t, null, XPathResult.ANY_TYPE, null);
39
+ return;
40
+ } catch (e) {
41
+ return e instanceof Error && e.message || "Invalid XPath";
42
+ }
43
+ }
44
+ function p(t) {
45
+ return t.includes("'") && t.includes("\"") ? e : void 0;
46
+ }
47
+ function m(e) {
48
+ return e.map((e) => `local-name()='${e}'`).join(" or ");
49
+ }
50
+ function h(e, t) {
51
+ let n = g(e);
52
+ return t ? `[parent::*[${n}]]` : `[${n}]`;
53
+ }
54
+ function g({ match: e, value: t }) {
55
+ let n = y(t);
56
+ switch (e) {
57
+ case "equals": return `@name=${n}`;
58
+ case "starts-with":
59
+ case "contains": return `${e}(@name,${n})`;
60
+ case "ends-with": return `substring(@name,string-length(@name)-string-length(${n})+1)=${n}`;
61
+ }
62
+ }
63
+ function _(e) {
64
+ return [...e.matchAll(/local-name\(\)='([^']+)'/g)].map((e) => e[1]);
65
+ }
66
+ function v(e) {
67
+ let t = s.exec(e);
68
+ if (!t) return;
69
+ let [, n, r, i, a, o] = t;
70
+ return n ? {
71
+ match: "equals",
72
+ value: b(n)
73
+ } : r && i ? {
74
+ match: r,
75
+ value: b(i)
76
+ } : a === o ? {
77
+ match: "ends-with",
78
+ value: b(a)
79
+ } : void 0;
80
+ }
81
+ function y(t) {
82
+ if (p(t)) throw Error(e);
83
+ return t.includes("'") ? `"${t}"` : `'${t}'`;
84
+ }
85
+ function b(e) {
86
+ return e.slice(1, -1);
87
+ }
88
+ function x(e) {
89
+ if (!n.test(e)) throw Error(`Invalid element name "${e}"`);
90
+ }
91
+ //#endregion
92
+ export { l as buildXpath, d as matchName, u as parseXpath, p as validateSearchText, f as validateXpath };