eat-js-sdk 2.6.0 → 2.6.2
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/interaction-builder.mjs +19 -47
- package/package.json +1 -1
|
@@ -5444,6 +5444,7 @@ async function typesetMathJax(element) {
|
|
|
5444
5444
|
const mathJax = window.MathJax;
|
|
5445
5445
|
if (!mathJax) return;
|
|
5446
5446
|
if (mathJax.startup?.promise) await mathJax.startup.promise;
|
|
5447
|
+
if (!element.isConnected) return;
|
|
5447
5448
|
if (typeof mathJax.typesetPromise === "function") {
|
|
5448
5449
|
await mathJax.typesetPromise([element]);
|
|
5449
5450
|
} else if (typeof mathJax.typeset === "function") {
|
|
@@ -5470,11 +5471,10 @@ async function getMathJaxSpeechText(html2) {
|
|
|
5470
5471
|
if (staging.parentNode) staging.remove();
|
|
5471
5472
|
}
|
|
5472
5473
|
}
|
|
5473
|
-
var root_2$g = /* @__PURE__ */ from_html(`<
|
|
5474
|
-
var root_3$d = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
5474
|
+
var root_2$g = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
5475
5475
|
function CommonStringToHtml($$anchor, $$props) {
|
|
5476
5476
|
push($$props, true);
|
|
5477
|
-
let htmlString = prop($$props, "htmlString", 7, ""), otherClass = prop($$props, "otherClass", 7, ""), ariaHidden = prop($$props, "ariaHidden", 7, false), htmlHeading = prop($$props, "htmlHeading", 7, ""), dataTestId = prop($$props, "dataTestId", 7)
|
|
5477
|
+
let htmlString = prop($$props, "htmlString", 7, ""), otherClass = prop($$props, "otherClass", 7, ""), ariaHidden = prop($$props, "ariaHidden", 7, false), htmlHeading = prop($$props, "htmlHeading", 7, ""), dataTestId = prop($$props, "dataTestId", 7);
|
|
5478
5478
|
let hasMath = /* @__PURE__ */ user_derived(() => hasMathJax(htmlString() ?? ""));
|
|
5479
5479
|
let processedHtml = /* @__PURE__ */ user_derived(() => processHtmlString(htmlString(), htmlHeading()));
|
|
5480
5480
|
let containerEl = /* @__PURE__ */ state(void 0);
|
|
@@ -5538,57 +5538,31 @@ function CommonStringToHtml($$anchor, $$props) {
|
|
|
5538
5538
|
set dataTestId($$value) {
|
|
5539
5539
|
dataTestId($$value);
|
|
5540
5540
|
flushSync();
|
|
5541
|
-
},
|
|
5542
|
-
get tag() {
|
|
5543
|
-
return tag();
|
|
5544
|
-
},
|
|
5545
|
-
set tag($$value = "div") {
|
|
5546
|
-
tag($$value);
|
|
5547
|
-
flushSync();
|
|
5548
5541
|
}
|
|
5549
5542
|
};
|
|
5550
5543
|
var fragment = comment();
|
|
5551
5544
|
var node = first_child(fragment);
|
|
5552
5545
|
{
|
|
5553
|
-
var
|
|
5546
|
+
var consequent = ($$anchor2) => {
|
|
5554
5547
|
var fragment_1 = comment();
|
|
5555
5548
|
var node_1 = first_child(fragment_1);
|
|
5556
|
-
{
|
|
5557
|
-
var
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
set_attribute(span, "data-testid", dataTestId());
|
|
5567
|
-
});
|
|
5568
|
-
append($$anchor3, span);
|
|
5569
|
-
};
|
|
5570
|
-
var alternate = ($$anchor3) => {
|
|
5571
|
-
var div = root_3$d();
|
|
5572
|
-
var node_3 = child(div);
|
|
5573
|
-
html(node_3, () => get$1(processedHtml));
|
|
5574
|
-
reset(div);
|
|
5575
|
-
bind_this(div, ($$value) => set(containerEl, $$value), () => get$1(containerEl));
|
|
5576
|
-
template_effect(() => {
|
|
5577
|
-
set_class(div, 1, clsx(otherClass()));
|
|
5578
|
-
set_attribute(div, "aria-hidden", ariaHidden());
|
|
5579
|
-
set_attribute(div, "data-testid", dataTestId());
|
|
5580
|
-
});
|
|
5581
|
-
append($$anchor3, div);
|
|
5582
|
-
};
|
|
5583
|
-
if_block(node_1, ($$render) => {
|
|
5584
|
-
if (tag() === "span") $$render(consequent);
|
|
5585
|
-
else $$render(alternate, false);
|
|
5549
|
+
key(node_1, htmlString, ($$anchor3) => {
|
|
5550
|
+
var div = root_2$g();
|
|
5551
|
+
var node_2 = child(div);
|
|
5552
|
+
html(node_2, () => get$1(processedHtml));
|
|
5553
|
+
reset(div);
|
|
5554
|
+
bind_this(div, ($$value) => set(containerEl, $$value), () => get$1(containerEl));
|
|
5555
|
+
template_effect(() => {
|
|
5556
|
+
set_class(div, 1, clsx(otherClass()));
|
|
5557
|
+
set_attribute(div, "aria-hidden", ariaHidden());
|
|
5558
|
+
set_attribute(div, "data-testid", dataTestId());
|
|
5586
5559
|
});
|
|
5587
|
-
|
|
5560
|
+
append($$anchor3, div);
|
|
5561
|
+
});
|
|
5588
5562
|
append($$anchor2, fragment_1);
|
|
5589
5563
|
};
|
|
5590
5564
|
if_block(node, ($$render) => {
|
|
5591
|
-
if (get$1(processedHtml)) $$render(
|
|
5565
|
+
if (get$1(processedHtml)) $$render(consequent);
|
|
5592
5566
|
});
|
|
5593
5567
|
}
|
|
5594
5568
|
append($$anchor, fragment);
|
|
@@ -5601,8 +5575,7 @@ create_custom_element(
|
|
|
5601
5575
|
otherClass: {},
|
|
5602
5576
|
ariaHidden: {},
|
|
5603
5577
|
htmlHeading: {},
|
|
5604
|
-
dataTestId: {}
|
|
5605
|
-
tag: {}
|
|
5578
|
+
dataTestId: {}
|
|
5606
5579
|
},
|
|
5607
5580
|
[],
|
|
5608
5581
|
[],
|
|
@@ -6878,7 +6851,7 @@ create_custom_element(
|
|
|
6878
6851
|
true
|
|
6879
6852
|
);
|
|
6880
6853
|
const useRemoveRichTextHtmlTags = (htmlString) => {
|
|
6881
|
-
return htmlString.replace(/<\/p>/g, " ").replace(/<[^>]*>/g, "").trim();
|
|
6854
|
+
return htmlString.replace(/<\/p>/g, " ").replace(/<[^>]*>/g, "").replace(/\[eat-eq\]([\s\S]*?)\[\/eat-eq\]/g, "$1").trim();
|
|
6882
6855
|
};
|
|
6883
6856
|
const { LG: SCREEN_LG, MD: SCREEN_MD } = BREAKPOINTS;
|
|
6884
6857
|
const CAPTION_GAP = 16;
|
|
@@ -19098,7 +19071,6 @@ function DropdownInteractionContent($$anchor, $$props) {
|
|
|
19098
19071
|
{
|
|
19099
19072
|
var consequent_1 = ($$anchor5) => {
|
|
19100
19073
|
CommonStringToHtml($$anchor5, {
|
|
19101
|
-
tag: "span",
|
|
19102
19074
|
get htmlString() {
|
|
19103
19075
|
return get$1(part).text;
|
|
19104
19076
|
},
|