@dialpad/dialtone-vue 3.202.0 → 3.204.0
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/dist/common/test-utils/node-traversal.cjs +2 -0
- package/dist/common/test-utils/node-traversal.cjs.map +1 -0
- package/dist/common/test-utils/node-traversal.js +54 -0
- package/dist/common/test-utils/node-traversal.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +155 -153
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.cjs.map +1 -1
- package/dist/lib/button/button.js +146 -81
- package/dist/lib/button/button.js.map +1 -1
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/lib/datepicker/datepicker.js +306 -242
- package/dist/lib/datepicker/datepicker.js.map +1 -1
- package/dist/lib/datepicker/utils.cjs +1 -1
- package/dist/lib/datepicker/utils.cjs.map +1 -1
- package/dist/lib/datepicker/utils.js +40 -40
- package/dist/lib/datepicker/utils.js.map +1 -1
- package/dist/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.cjs.map +1 -1
- package/dist/lib/editor/editor.js +284 -148
- package/dist/lib/editor/editor.js.map +1 -1
- package/dist/lib/general-row/index.cjs +1 -1
- package/dist/lib/general-row/index.js +6 -4
- package/dist/lib/general-row/index.js.map +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.cjs.map +1 -1
- package/dist/lib/link/link.js +58 -18
- package/dist/lib/link/link.js.map +1 -1
- package/dist/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/lib/list-item-group/list-item-group.js +5 -5
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.cjs.map +1 -1
- package/dist/lib/message-input/message-input.js +9 -7
- package/dist/lib/message-input/message-input.js.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +466 -283
- package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +69 -67
- package/dist/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/localization/en-US.cjs +6 -0
- package/dist/localization/en-US.cjs.map +1 -1
- package/dist/localization/en-US.js +6 -0
- package/dist/localization/en-US.js.map +1 -1
- package/dist/types/common/sr_only_close_button.vue.d.ts +68 -1
- package/dist/types/common/test_utils/node_traversal.d.ts +10 -0
- package/dist/types/common/test_utils/node_traversal.d.ts.map +1 -0
- package/dist/types/components/banner/banner.vue.d.ts +136 -2
- package/dist/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts +39 -1
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.vue.d.ts +39 -1
- package/dist/types/components/button/button.vue.d.ts +68 -1
- package/dist/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +68 -1
- package/dist/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +68 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/types/components/datepicker/composables/useMonthYearPicker.d.ts +4 -0
- package/dist/types/components/datepicker/composables/useMonthYearPicker.d.ts.map +1 -1
- package/dist/types/components/datepicker/datepicker.vue.d.ts +8 -0
- package/dist/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
- package/dist/types/components/datepicker/modules/month-year-picker.vue.d.ts +4 -0
- package/dist/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
- package/dist/types/components/datepicker/utils.d.ts +1 -1
- package/dist/types/components/datepicker/utils.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +136 -2
- package/dist/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/types/components/hovercard/hovercard.vue.d.ts +272 -4
- package/dist/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts +136 -2
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/types/components/link/link.vue.d.ts +39 -1
- package/dist/types/components/link/link.vue.d.ts.map +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +136 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice.vue.d.ts +136 -2
- package/dist/types/components/notice/notice.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +136 -2
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/pagination/pagination.vue.d.ts +68 -1
- package/dist/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover.vue.d.ts +136 -2
- package/dist/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +68 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +39 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +39 -1
- package/dist/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +1804 -0
- package/dist/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/extensions/variable/index.d.ts +3 -0
- package/dist/types/components/rich_text_editor/extensions/variable/index.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/extensions/variable/variable.d.ts +3 -0
- package/dist/types/components/rich_text_editor/extensions/variable/variable.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +87 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts +68 -1
- package/dist/types/components/split_button/split_button-omega.vue.d.ts +68 -1
- package/dist/types/components/split_button/split_button-omega.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button.vue.d.ts +272 -4
- package/dist/types/components/split_button/split_button.vue.d.ts.map +1 -1
- package/dist/types/components/tab/tab.vue.d.ts +68 -1
- package/dist/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +136 -2
- package/dist/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
- package/dist/types/components/toast/layouts/toast_layout_default.vue.d.ts +136 -2
- package/dist/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
- package/dist/types/components/toast/toast.vue.d.ts +544 -8
- package/dist/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +68 -1
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +272 -4
- package/dist/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +272 -4
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +204 -3
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +68 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +136 -2
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +272 -4
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +204 -3
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts +664 -4
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +631 -9
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +272 -4
- package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +68 -1
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/index.d.ts +1 -0
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(e,t){t(e),e.content&&e.content.forEach(r=>a(r,t))}function i(e,t){e&&Array.isArray(e)&&e.forEach(r=>a(r,t))}function o(e,t){let r=null;return i(e,n=>{!r&&t(n)&&(r=n)}),r}function u(e,t){return o(e,r=>{var n;return r.type==="variable"&&((n=r.attrs)==null?void 0:n.id)===t})}function f(e,t){const r=[];return i(e,n=>{t(n)&&r.push(n)}),r}function s(e){return f(e,t=>t.type==="variable")}function l(e,t){let r=0;return i(e,n=>{t(n)&&r++}),r}function c(e){return l(e,t=>t.type==="variable")}function d(e,t){return u(e,t)!==null}exports.countNodes=l;exports.countVariables=c;exports.findAllNodes=f;exports.findAllVariables=s;exports.findNode=o;exports.findVariable=u;exports.traverseNode=a;exports.traverseNodes=i;exports.variableExists=d;
|
|
2
|
+
//# sourceMappingURL=node-traversal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-traversal.cjs","sources":["../../../common/test_utils/node_traversal.js"],"sourcesContent":["/**\n * Utility functions for traversing and searching nodes in editor JSON structures\n */\n\n/**\n * Traverses a node tree and calls a callback function for each node\n * @param {Object} node - The node to traverse\n * @param {Function} callback - Function to call for each node\n */\nexport function traverseNode(node, callback) {\n callback(node);\n if (node.content) {\n node.content.forEach(childNode => traverseNode(childNode, callback));\n }\n}\n\n/**\n * Traverses an array of nodes (typically the root content array)\n * @param {Array} nodes - Array of nodes to traverse\n * @param {Function} callback - Function to call for each node\n */\nexport function traverseNodes(nodes, callback) {\n if (nodes && Array.isArray(nodes)) {\n nodes.forEach(node => traverseNode(node, callback));\n }\n}\n\n/**\n * Finds a node matching a condition in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true when the desired node is found\n * @returns {Object|null} The found node or null\n */\nexport function findNode(nodes, predicate) {\n let foundNode = null;\n\n traverseNodes(nodes, (node) => {\n if (!foundNode && predicate(node)) {\n foundNode = node;\n }\n });\n\n return foundNode;\n}\n\n/**\n * Finds a variable node by its ID\n * @param {Array} nodes - Array of nodes to search\n * @param {string} variableId - The ID of the variable to find\n * @returns {Object|null} The variable node or null\n */\nexport function findVariable(nodes, variableId) {\n return findNode(nodes, node =>\n node.type === 'variable' && node.attrs?.id === variableId,\n );\n}\n\n/**\n * Finds all nodes matching a condition\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true for nodes to include\n * @returns {Array} Array of matching nodes\n */\nexport function findAllNodes(nodes, predicate) {\n const foundNodes = [];\n\n traverseNodes(nodes, (node) => {\n if (predicate(node)) {\n foundNodes.push(node);\n }\n });\n\n return foundNodes;\n}\n\n/**\n * Finds all variable nodes in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @returns {Array} Array of variable nodes\n */\nexport function findAllVariables(nodes) {\n return findAllNodes(nodes, node => node.type === 'variable');\n}\n\n/**\n * Counts nodes matching a condition\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true for nodes to count\n * @returns {number} Count of matching nodes\n */\nexport function countNodes(nodes, predicate) {\n let count = 0;\n\n traverseNodes(nodes, (node) => {\n if (predicate(node)) {\n count++;\n }\n });\n\n return count;\n}\n\n/**\n * Counts variable nodes in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @returns {number} Count of variable nodes\n */\nexport function countVariables(nodes) {\n return countNodes(nodes, node => node.type === 'variable');\n}\n\n/**\n * Checks if a variable with a specific ID exists\n * @param {Array} nodes - Array of nodes to search\n * @param {string} variableId - The ID of the variable to check\n * @returns {boolean} True if the variable exists\n */\nexport function variableExists(nodes, variableId) {\n return findVariable(nodes, variableId) !== null;\n}\n"],"names":["traverseNode","node","callback","childNode","traverseNodes","nodes","findNode","predicate","foundNode","findVariable","variableId","_a","findAllNodes","foundNodes","findAllVariables","countNodes","count","countVariables","variableExists"],"mappings":"gFASO,SAASA,EAAaC,EAAMC,EAAU,CAC3CA,EAASD,CAAI,EACTA,EAAK,SACPA,EAAK,QAAQ,QAAQE,GAAaH,EAAaG,EAAWD,CAAQ,CAAC,CAEvE,CAOO,SAASE,EAAcC,EAAOH,EAAU,CACzCG,GAAS,MAAM,QAAQA,CAAK,GAC9BA,EAAM,QAAQJ,GAAQD,EAAaC,EAAMC,CAAQ,CAAC,CAEtD,CAQO,SAASI,EAASD,EAAOE,EAAW,CACzC,IAAIC,EAAY,KAEhB,OAAAJ,EAAcC,EAAQJ,GAAS,CACzB,CAACO,GAAaD,EAAUN,CAAI,IAC9BO,EAAYP,EAEhB,CAAC,EAEMO,CACT,CAQO,SAASC,EAAaJ,EAAOK,EAAY,CAC9C,OAAOJ,EAASD,EAAOJ,GAAI,OACzB,OAAAA,EAAK,OAAS,cAAcU,EAAAV,EAAK,QAAL,YAAAU,EAAY,MAAOD,EACnD,CACA,CAQO,SAASE,EAAaP,EAAOE,EAAW,CAC7C,MAAMM,EAAa,CAAA,EAEnB,OAAAT,EAAcC,EAAQJ,GAAS,CACzBM,EAAUN,CAAI,GAChBY,EAAW,KAAKZ,CAAI,CAExB,CAAC,EAEMY,CACT,CAOO,SAASC,EAAiBT,EAAO,CACtC,OAAOO,EAAaP,EAAOJ,GAAQA,EAAK,OAAS,UAAU,CAC7D,CAQO,SAASc,EAAWV,EAAOE,EAAW,CAC3C,IAAIS,EAAQ,EAEZ,OAAAZ,EAAcC,EAAQJ,GAAS,CACzBM,EAAUN,CAAI,GAChBe,GAEJ,CAAC,EAEMA,CACT,CAOO,SAASC,EAAeZ,EAAO,CACpC,OAAOU,EAAWV,EAAOJ,GAAQA,EAAK,OAAS,UAAU,CAC3D,CAQO,SAASiB,EAAeb,EAAOK,EAAY,CAChD,OAAOD,EAAaJ,EAAOK,CAAU,IAAM,IAC7C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function u(t, n) {
|
|
2
|
+
n(t), t.content && t.content.forEach((r) => u(r, n));
|
|
3
|
+
}
|
|
4
|
+
function e(t, n) {
|
|
5
|
+
t && Array.isArray(t) && t.forEach((r) => u(r, n));
|
|
6
|
+
}
|
|
7
|
+
function f(t, n) {
|
|
8
|
+
let r = null;
|
|
9
|
+
return e(t, (i) => {
|
|
10
|
+
!r && n(i) && (r = i);
|
|
11
|
+
}), r;
|
|
12
|
+
}
|
|
13
|
+
function o(t, n) {
|
|
14
|
+
return f(
|
|
15
|
+
t,
|
|
16
|
+
(r) => {
|
|
17
|
+
var i;
|
|
18
|
+
return r.type === "variable" && ((i = r.attrs) == null ? void 0 : i.id) === n;
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function a(t, n) {
|
|
23
|
+
const r = [];
|
|
24
|
+
return e(t, (i) => {
|
|
25
|
+
n(i) && r.push(i);
|
|
26
|
+
}), r;
|
|
27
|
+
}
|
|
28
|
+
function l(t) {
|
|
29
|
+
return a(t, (n) => n.type === "variable");
|
|
30
|
+
}
|
|
31
|
+
function c(t, n) {
|
|
32
|
+
let r = 0;
|
|
33
|
+
return e(t, (i) => {
|
|
34
|
+
n(i) && r++;
|
|
35
|
+
}), r;
|
|
36
|
+
}
|
|
37
|
+
function s(t) {
|
|
38
|
+
return c(t, (n) => n.type === "variable");
|
|
39
|
+
}
|
|
40
|
+
function d(t, n) {
|
|
41
|
+
return o(t, n) !== null;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
c as countNodes,
|
|
45
|
+
s as countVariables,
|
|
46
|
+
a as findAllNodes,
|
|
47
|
+
l as findAllVariables,
|
|
48
|
+
f as findNode,
|
|
49
|
+
o as findVariable,
|
|
50
|
+
u as traverseNode,
|
|
51
|
+
e as traverseNodes,
|
|
52
|
+
d as variableExists
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=node-traversal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-traversal.js","sources":["../../../common/test_utils/node_traversal.js"],"sourcesContent":["/**\n * Utility functions for traversing and searching nodes in editor JSON structures\n */\n\n/**\n * Traverses a node tree and calls a callback function for each node\n * @param {Object} node - The node to traverse\n * @param {Function} callback - Function to call for each node\n */\nexport function traverseNode(node, callback) {\n callback(node);\n if (node.content) {\n node.content.forEach(childNode => traverseNode(childNode, callback));\n }\n}\n\n/**\n * Traverses an array of nodes (typically the root content array)\n * @param {Array} nodes - Array of nodes to traverse\n * @param {Function} callback - Function to call for each node\n */\nexport function traverseNodes(nodes, callback) {\n if (nodes && Array.isArray(nodes)) {\n nodes.forEach(node => traverseNode(node, callback));\n }\n}\n\n/**\n * Finds a node matching a condition in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true when the desired node is found\n * @returns {Object|null} The found node or null\n */\nexport function findNode(nodes, predicate) {\n let foundNode = null;\n\n traverseNodes(nodes, (node) => {\n if (!foundNode && predicate(node)) {\n foundNode = node;\n }\n });\n\n return foundNode;\n}\n\n/**\n * Finds a variable node by its ID\n * @param {Array} nodes - Array of nodes to search\n * @param {string} variableId - The ID of the variable to find\n * @returns {Object|null} The variable node or null\n */\nexport function findVariable(nodes, variableId) {\n return findNode(nodes, node =>\n node.type === 'variable' && node.attrs?.id === variableId,\n );\n}\n\n/**\n * Finds all nodes matching a condition\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true for nodes to include\n * @returns {Array} Array of matching nodes\n */\nexport function findAllNodes(nodes, predicate) {\n const foundNodes = [];\n\n traverseNodes(nodes, (node) => {\n if (predicate(node)) {\n foundNodes.push(node);\n }\n });\n\n return foundNodes;\n}\n\n/**\n * Finds all variable nodes in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @returns {Array} Array of variable nodes\n */\nexport function findAllVariables(nodes) {\n return findAllNodes(nodes, node => node.type === 'variable');\n}\n\n/**\n * Counts nodes matching a condition\n * @param {Array} nodes - Array of nodes to search\n * @param {Function} predicate - Function that returns true for nodes to count\n * @returns {number} Count of matching nodes\n */\nexport function countNodes(nodes, predicate) {\n let count = 0;\n\n traverseNodes(nodes, (node) => {\n if (predicate(node)) {\n count++;\n }\n });\n\n return count;\n}\n\n/**\n * Counts variable nodes in the node tree\n * @param {Array} nodes - Array of nodes to search\n * @returns {number} Count of variable nodes\n */\nexport function countVariables(nodes) {\n return countNodes(nodes, node => node.type === 'variable');\n}\n\n/**\n * Checks if a variable with a specific ID exists\n * @param {Array} nodes - Array of nodes to search\n * @param {string} variableId - The ID of the variable to check\n * @returns {boolean} True if the variable exists\n */\nexport function variableExists(nodes, variableId) {\n return findVariable(nodes, variableId) !== null;\n}\n"],"names":["traverseNode","node","callback","childNode","traverseNodes","nodes","findNode","predicate","foundNode","findVariable","variableId","_a","findAllNodes","foundNodes","findAllVariables","countNodes","count","countVariables","variableExists"],"mappings":"AASO,SAASA,EAAaC,GAAMC,GAAU;AAC3C,EAAAA,EAASD,CAAI,GACTA,EAAK,WACPA,EAAK,QAAQ,QAAQ,CAAAE,MAAaH,EAAaG,GAAWD,CAAQ,CAAC;AAEvE;AAOO,SAASE,EAAcC,GAAOH,GAAU;AAC7C,EAAIG,KAAS,MAAM,QAAQA,CAAK,KAC9BA,EAAM,QAAQ,CAAAJ,MAAQD,EAAaC,GAAMC,CAAQ,CAAC;AAEtD;AAQO,SAASI,EAASD,GAAOE,GAAW;AACzC,MAAIC,IAAY;AAEhB,SAAAJ,EAAcC,GAAO,CAACJ,MAAS;AAC7B,IAAI,CAACO,KAAaD,EAAUN,CAAI,MAC9BO,IAAYP;AAAA,EAEhB,CAAC,GAEMO;AACT;AAQO,SAASC,EAAaJ,GAAOK,GAAY;AAC9C,SAAOJ;AAAA,IAASD;AAAA,IAAO,CAAAJ,MAAI;AApD7B,UAAAU;AAqDI,aAAAV,EAAK,SAAS,gBAAcU,IAAAV,EAAK,UAAL,gBAAAU,EAAY,QAAOD;AAAA;AAAA,EACnD;AACA;AAQO,SAASE,EAAaP,GAAOE,GAAW;AAC7C,QAAMM,IAAa,CAAA;AAEnB,SAAAT,EAAcC,GAAO,CAACJ,MAAS;AAC7B,IAAIM,EAAUN,CAAI,KAChBY,EAAW,KAAKZ,CAAI;AAAA,EAExB,CAAC,GAEMY;AACT;AAOO,SAASC,EAAiBT,GAAO;AACtC,SAAOO,EAAaP,GAAO,CAAAJ,MAAQA,EAAK,SAAS,UAAU;AAC7D;AAQO,SAASc,EAAWV,GAAOE,GAAW;AAC3C,MAAIS,IAAQ;AAEZ,SAAAZ,EAAcC,GAAO,CAACJ,MAAS;AAC7B,IAAIM,EAAUN,CAAI,KAChBe;AAAA,EAEJ,CAAC,GAEMA;AACT;AAOO,SAASC,EAAeZ,GAAO;AACpC,SAAOU,EAAWV,GAAO,CAAAJ,MAAQA,EAAK,SAAS,UAAU;AAC3D;AAQO,SAASiB,EAAeb,GAAOK,GAAY;AAChD,SAAOD,EAAaJ,GAAOK,CAAU,MAAM;AAC7C;"}
|