eat-js-sdk 2.7.0 → 2.7.1
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 +38 -46
- package/package.json +1 -1
|
@@ -7077,10 +7077,10 @@ function useImageModalSize() {
|
|
|
7077
7077
|
};
|
|
7078
7078
|
}
|
|
7079
7079
|
var root_4$8 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
7080
|
-
var root_5$
|
|
7080
|
+
var root_5$9 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
7081
7081
|
var root_7$7 = /* @__PURE__ */ from_html(`<span class="sr-only"><!></span>`);
|
|
7082
7082
|
var root_6$4 = /* @__PURE__ */ from_html(`<div><!> <span aria-hidden="true"><!></span></div>`);
|
|
7083
|
-
var root_10$
|
|
7083
|
+
var root_10$4 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
7084
7084
|
var root_11$2 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
7085
7085
|
var root_2$f = /* @__PURE__ */ from_html(`<div class="absolute inset-0 m-0"><div class="w-full h-full px-0 md:px-[82px] lg:px-[128px] pt-14 pb-[72px] relative lg:py-24 flex flex-col items-center justify-center"><div aria-live="polite" aria-atomic="true" class="sr-only"><!> <!></div> <div class="w-full h-full flex flex-col md:flex-row md:justify-center items-center justify-between"><div class="md:hidden"></div> <!> <!> <div><div class="flex-shrink-0 flex items-center justify-between py-1 px-2 md:px-4 border-border-minimal border rounded-t-md lg:rounded-t-lg md:gap-4 h-8.5 md:h-fit"><!> <!> <!></div> <div class="rounded-b-md"><img class="mx-auto block rounded-b-md lg:rounded-b-lg object-contain max-w-full max-h-[calc(100vh-168px-34px)] md:max-h-[calc(100vh-128px-54px)] lg:max-h-[calc(100vh-192px-54px)] pointer-events-none"/></div></div> <div class="md:hidden flex justify-center items-center gap-1 flex-shrink-0 h-6 mt-4"><!> <!></div></div></div></div>`);
|
|
7086
7086
|
function MCQImageModal($$anchor, $$props) {
|
|
@@ -7351,7 +7351,7 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7351
7351
|
dataTestId: "img-viewer-next",
|
|
7352
7352
|
onclick: navigateNext,
|
|
7353
7353
|
children: ($$anchor4, $$slotProps2) => {
|
|
7354
|
-
var span_1 = root_5$
|
|
7354
|
+
var span_1 = root_5$9();
|
|
7355
7355
|
var node_6 = child(span_1);
|
|
7356
7356
|
SvgLoader(node_6, {
|
|
7357
7357
|
svgName: "smallChevronRight",
|
|
@@ -7473,7 +7473,7 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7473
7473
|
dataTestId: "img-viewer-prev",
|
|
7474
7474
|
onclick: navigatePrevious,
|
|
7475
7475
|
children: ($$anchor4, $$slotProps2) => {
|
|
7476
|
-
var span_4 = root_10$
|
|
7476
|
+
var span_4 = root_10$4();
|
|
7477
7477
|
var node_14 = child(span_4);
|
|
7478
7478
|
SvgLoader(node_14, {
|
|
7479
7479
|
svgName: "smallChevronLeft",
|
|
@@ -7710,7 +7710,7 @@ function InteractionSection($$anchor, $$props) {
|
|
|
7710
7710
|
return pop($$exports);
|
|
7711
7711
|
}
|
|
7712
7712
|
create_custom_element(InteractionSection, { children: {} }, [], [], true);
|
|
7713
|
-
var root_5$
|
|
7713
|
+
var root_5$8 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7714
7714
|
var root_4$7 = /* @__PURE__ */ from_html(`<div class="px-4 w-full max-w-[1008px] mx-auto flex-shrink-0 text-center font-semibold text-sm md:text-lg leading-[150%] text-white" aria-hidden="true" data-testid="img-viewer-cap-txt"> </div> <!>`, 1);
|
|
7715
7715
|
var root_7$6 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7716
7716
|
var root_2$e = /* @__PURE__ */ from_html(`<div class="absolute inset-0"><div class="w-full h-full flex items-center justify-center pt-14 pb-[72px] lg:py-24"><div aria-live="polite" aria-atomic="true" class="sr-only"> </div> <div class="flex flex-col items-center overflow-y-auto overflow-x-hidden w-full px-0 md:px-6 lg:px-16"><div class="relative bg-white rounded-md md:rounded-lg shadow-sm overflow-hidden flex-shrink-0"><img class="block object-contain w-full h-auto max-w-full mx-auto"/> <!></div> <!></div></div></div>`);
|
|
@@ -7884,7 +7884,7 @@ function PromptStimulusImageModal($$anchor, $$props) {
|
|
|
7884
7884
|
var node_3 = sibling(div_5, 2);
|
|
7885
7885
|
{
|
|
7886
7886
|
var consequent = ($$anchor5) => {
|
|
7887
|
-
var div_6 = root_5$
|
|
7887
|
+
var div_6 = root_5$8();
|
|
7888
7888
|
template_effect(() => set_style(div_6, `height:${get$1(bottomSpacerHeight) ?? ""}px`));
|
|
7889
7889
|
append($$anchor5, div_6);
|
|
7890
7890
|
};
|
|
@@ -8367,7 +8367,7 @@ const shouldRenderSection = (section) => section.condition !== false;
|
|
|
8367
8367
|
const getClassString = (classes = []) => classes.join(" ");
|
|
8368
8368
|
const getStyleString = (styles = {}) => Object.entries(styles).map(([k, v]) => `${k}:${v}`).join(";");
|
|
8369
8369
|
var root_4$6 = /* @__PURE__ */ from_html(`<p class="text-lg leading-[22px] text-blue-1000 font-semibold mt-4" data-testid="img-cap-txt"> </p>`);
|
|
8370
|
-
var root_5$
|
|
8370
|
+
var root_5$7 = /* @__PURE__ */ from_html(`<div class="mt-6 w-full"><button class="flex items-center font-semibold leading-[1.5] outline-none group w-fit h-11 text-charcoal" aria-controls="long-description-content" aria-labelledby="image-description-label" type="button"><div class="w-6 h-6 flex items-center justify-center mr-2" data-testid="img-desc-txt"><!></div> <div id="image-description-label" class="image-description-accordion group-[.active]:border-b-2">Image Description</div></button> <div id="long-description-content" data-testid="img-desc-txt"><!></div></div>`);
|
|
8371
8371
|
var root_2$d = /* @__PURE__ */ from_html(`<div class="flex flex-col justify-center items-center text-center"><div class="flex flex-col items-center"><div class="relative inline-block"><img/> <!></div> <!></div></div> <!>`, 1);
|
|
8372
8372
|
var root_1$j = /* @__PURE__ */ from_html(`<div class="w-full"><!></div>`);
|
|
8373
8373
|
function CommonMedia($$anchor, $$props) {
|
|
@@ -8500,7 +8500,7 @@ function CommonMedia($$anchor, $$props) {
|
|
|
8500
8500
|
var node_4 = sibling(div_1, 2);
|
|
8501
8501
|
{
|
|
8502
8502
|
var consequent_1 = ($$anchor4) => {
|
|
8503
|
-
var div_4 = root_5$
|
|
8503
|
+
var div_4 = root_5$7();
|
|
8504
8504
|
var button = child(div_4);
|
|
8505
8505
|
button.__click = toggleLongDescription;
|
|
8506
8506
|
button.__keydown = handleKeyDown;
|
|
@@ -8693,10 +8693,12 @@ function getTranscriptionSRText(html2) {
|
|
|
8693
8693
|
return toTranscriptionReadableText(plain);
|
|
8694
8694
|
}).replace(/<[^>]+>/g, "").replace(/<\/?eat-transcription>/gi, "").replace(/\s{2,}/g, " ").trim();
|
|
8695
8695
|
}
|
|
8696
|
+
var root_5$6 = /* @__PURE__ */ from_html(`<p class="sr-only"><!></p>`);
|
|
8696
8697
|
var root_4$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!> <!></div>`);
|
|
8697
8698
|
var root_6$3 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8698
8699
|
var root_3$b = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8699
8700
|
var root_8$6 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8701
|
+
var root_10$3 = /* @__PURE__ */ from_html(`<p class="sr-only"><!></p>`);
|
|
8700
8702
|
var root_9$4 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!> <!></div>`);
|
|
8701
8703
|
var root_7$5 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8702
8704
|
var root_1$i = /* @__PURE__ */ from_html(`<div class="stimulus-section flex flex-col w-full"><!> <div><!></div></div>`);
|
|
@@ -8718,9 +8720,9 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8718
8720
|
let isTextFirst = /* @__PURE__ */ user_derived(() => stimulusData().stimulusLayoutOrder === LAYOUT_ORDER.TEXT_FIRST);
|
|
8719
8721
|
let configuredStimulusText = /* @__PURE__ */ user_derived(() => configureHtmlString(stimulusData().stimulusText, getStimulusTextMaxHeight(stimulusData().fileAlignment, stimulusData().stimulusTextAlignment, stimulusData().hasMedia, stimulusData().hasText)));
|
|
8720
8722
|
let configuredLongDescription = /* @__PURE__ */ user_derived(() => configureHtmlString(stimulusData().longDescription, getStimulusTextMaxHeight(stimulusData().fileAlignment, stimulusData().stimulusTextAlignment, stimulusData().hasMedia, stimulusData().hasText)));
|
|
8721
|
-
const
|
|
8723
|
+
const { segmentAndAnnotate } = useLanguageAnnotator();
|
|
8722
8724
|
let hasTranscription = /* @__PURE__ */ user_derived(() => /<eat-transcription>/i.test(stimulusData().stimulusText ?? ""));
|
|
8723
|
-
let stimulusSRText = /* @__PURE__ */ user_derived(() => get$1(hasTranscription) ? getTranscriptionSRText(stimulusData().stimulusText ?? "") : "");
|
|
8725
|
+
let stimulusSRText = /* @__PURE__ */ user_derived(() => get$1(hasTranscription) ? segmentAndAnnotate(getTranscriptionSRText(stimulusData().stimulusText ?? "")) : "");
|
|
8724
8726
|
const shouldShowText = /* @__PURE__ */ user_derived(() => stimulusData().hasText && (stimulusData().stimulusTextAlignment === stimulusAlignment() || stimulusData().stimulusTextAlignment !== stimulusAlignment() && windowWidth.value < BREAKPOINTS.LG) && (!stimulusType() || stimulusType() === "stimulus-text"));
|
|
8725
8727
|
const shouldShowMedia = /* @__PURE__ */ user_derived(() => stimulusData().hasMedia && (stimulusData().fileAlignment === stimulusAlignment() || stimulusData().fileAlignment !== stimulusAlignment() && windowWidth.value < BREAKPOINTS.LG) && (!stimulusType() || stimulusType() === "stimulus-media"));
|
|
8726
8728
|
let textContainerClass = /* @__PURE__ */ user_derived(() => `stimulus-text ${get$1(isInlineText) ? "inline-text" : "block-text"}`);
|
|
@@ -8810,16 +8812,11 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8810
8812
|
var node_5 = sibling(node_4, 2);
|
|
8811
8813
|
{
|
|
8812
8814
|
var consequent_1 = ($$anchor5) => {
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
},
|
|
8819
|
-
otherClass: "sr-only",
|
|
8820
|
-
tag: "span"
|
|
8821
|
-
});
|
|
8822
|
-
}
|
|
8815
|
+
var p = root_5$6();
|
|
8816
|
+
var node_6 = child(p);
|
|
8817
|
+
html(node_6, () => get$1(stimulusSRText));
|
|
8818
|
+
reset(p);
|
|
8819
|
+
append($$anchor5, p);
|
|
8823
8820
|
};
|
|
8824
8821
|
if_block(node_5, ($$render) => {
|
|
8825
8822
|
if (get$1(hasTranscription)) $$render(consequent_1);
|
|
@@ -8833,13 +8830,13 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8833
8830
|
if (get$1(shouldShowText)) $$render(consequent_2);
|
|
8834
8831
|
});
|
|
8835
8832
|
}
|
|
8836
|
-
var
|
|
8833
|
+
var node_7 = sibling(node_3, 2);
|
|
8837
8834
|
{
|
|
8838
8835
|
var consequent_3 = ($$anchor4) => {
|
|
8839
8836
|
var div_3 = root_6$3();
|
|
8840
8837
|
let classes_2;
|
|
8841
|
-
var
|
|
8842
|
-
CommonMedia(
|
|
8838
|
+
var node_8 = child(div_3);
|
|
8839
|
+
CommonMedia(node_8, {
|
|
8843
8840
|
get fileUrl() {
|
|
8844
8841
|
return stimulusData().fileUrl;
|
|
8845
8842
|
},
|
|
@@ -8864,21 +8861,21 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8864
8861
|
template_effect(() => classes_2 = set_class(div_3, 1, `stimulus-img-ctr ${get$1(mediaContainerClass) ?? ""}`, null, classes_2, { hidden: !get$1(shouldShowMedia) }));
|
|
8865
8862
|
append($$anchor4, div_3);
|
|
8866
8863
|
};
|
|
8867
|
-
if_block(
|
|
8864
|
+
if_block(node_7, ($$render) => {
|
|
8868
8865
|
if (stimulusData().hasMedia) $$render(consequent_3);
|
|
8869
8866
|
});
|
|
8870
8867
|
}
|
|
8871
8868
|
append($$anchor3, fragment_2);
|
|
8872
8869
|
};
|
|
8873
8870
|
var alternate = ($$anchor3) => {
|
|
8874
|
-
var
|
|
8875
|
-
var
|
|
8871
|
+
var fragment_3 = root_7$5();
|
|
8872
|
+
var node_9 = first_child(fragment_3);
|
|
8876
8873
|
{
|
|
8877
8874
|
var consequent_5 = ($$anchor4) => {
|
|
8878
8875
|
var div_4 = root_8$6();
|
|
8879
8876
|
let classes_3;
|
|
8880
|
-
var
|
|
8881
|
-
CommonMedia(
|
|
8877
|
+
var node_10 = child(div_4);
|
|
8878
|
+
CommonMedia(node_10, {
|
|
8882
8879
|
get fileUrl() {
|
|
8883
8880
|
return stimulusData().fileUrl;
|
|
8884
8881
|
},
|
|
@@ -8903,16 +8900,16 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8903
8900
|
template_effect(() => classes_3 = set_class(div_4, 1, `stimulus-img-ctr ${get$1(mediaContainerClass) ?? ""}`, null, classes_3, { hidden: !get$1(shouldShowMedia) }));
|
|
8904
8901
|
append($$anchor4, div_4);
|
|
8905
8902
|
};
|
|
8906
|
-
if_block(
|
|
8903
|
+
if_block(node_9, ($$render) => {
|
|
8907
8904
|
if (stimulusData().hasMedia) $$render(consequent_5);
|
|
8908
8905
|
});
|
|
8909
8906
|
}
|
|
8910
|
-
var
|
|
8907
|
+
var node_11 = sibling(node_9, 2);
|
|
8911
8908
|
{
|
|
8912
8909
|
var consequent_7 = ($$anchor4) => {
|
|
8913
8910
|
var div_5 = root_9$4();
|
|
8914
|
-
var
|
|
8915
|
-
CommonStringToHtml(
|
|
8911
|
+
var node_12 = child(div_5);
|
|
8912
|
+
CommonStringToHtml(node_12, {
|
|
8916
8913
|
get htmlString() {
|
|
8917
8914
|
return get$1(configuredStimulusText);
|
|
8918
8915
|
},
|
|
@@ -8923,21 +8920,16 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8923
8920
|
return get$1(hasTranscription);
|
|
8924
8921
|
}
|
|
8925
8922
|
});
|
|
8926
|
-
var
|
|
8923
|
+
var node_13 = sibling(node_12, 2);
|
|
8927
8924
|
{
|
|
8928
8925
|
var consequent_6 = ($$anchor5) => {
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
},
|
|
8935
|
-
otherClass: "sr-only",
|
|
8936
|
-
tag: "span"
|
|
8937
|
-
});
|
|
8938
|
-
}
|
|
8926
|
+
var p_1 = root_10$3();
|
|
8927
|
+
var node_14 = child(p_1);
|
|
8928
|
+
html(node_14, () => get$1(stimulusSRText));
|
|
8929
|
+
reset(p_1);
|
|
8930
|
+
append($$anchor5, p_1);
|
|
8939
8931
|
};
|
|
8940
|
-
if_block(
|
|
8932
|
+
if_block(node_13, ($$render) => {
|
|
8941
8933
|
if (get$1(hasTranscription)) $$render(consequent_6);
|
|
8942
8934
|
});
|
|
8943
8935
|
}
|
|
@@ -8945,11 +8937,11 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8945
8937
|
template_effect(() => set_class(div_5, 1, `stimulus-txt-ctr ${get$1(textContainerClass) ?? ""}`));
|
|
8946
8938
|
append($$anchor4, div_5);
|
|
8947
8939
|
};
|
|
8948
|
-
if_block(
|
|
8940
|
+
if_block(node_11, ($$render) => {
|
|
8949
8941
|
if (get$1(shouldShowText)) $$render(consequent_7);
|
|
8950
8942
|
});
|
|
8951
8943
|
}
|
|
8952
|
-
append($$anchor3,
|
|
8944
|
+
append($$anchor3, fragment_3);
|
|
8953
8945
|
};
|
|
8954
8946
|
if_block(node_2, ($$render) => {
|
|
8955
8947
|
if (get$1(isTextFirst)) $$render(consequent_4);
|