eat-js-sdk 0.0.3 → 0.0.5

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.
@@ -895,6 +895,26 @@
895
895
  child_ctx[14] = i;
896
896
  return child_ctx;
897
897
  }
898
+ function create_if_block_1(ctx) {
899
+ let p;
900
+ return {
901
+ c() {
902
+ p = element("p");
903
+ p.textContent = `${/*rubric*/
904
+ ctx[2].text}`;
905
+ attr(p, "class", "h5 mb-2 md:mb-4");
906
+ },
907
+ m(target, anchor) {
908
+ insert(target, p, anchor);
909
+ },
910
+ p: noop,
911
+ d(detaching) {
912
+ if (detaching) {
913
+ detach(p);
914
+ }
915
+ }
916
+ };
917
+ }
898
918
  function create_if_block(ctx) {
899
919
  let div1;
900
920
  let div0;
@@ -936,7 +956,7 @@
936
956
  ctx2[0] ? "absolute inset-0 bg-transparent z-50" : "")) {
937
957
  attr(div0, "class", div0_class_value);
938
958
  }
939
- if (dirty & /*Object, options, selectedOption, handleOptionClick*/
959
+ if (dirty & /*selectedOption, Object, options, handleOptionClick*/
940
960
  50) {
941
961
  each_value = ensure_array_like(Object.entries(
942
962
  /*options*/
@@ -1002,7 +1022,9 @@
1002
1022
  t2 = text(t2_value);
1003
1023
  t3 = space();
1004
1024
  attr(span, "class", "choice group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]");
1005
- attr(button, "aria-label", button_aria_label_value = `Option ${useMCQ_default(
1025
+ attr(button, "aria-label", button_aria_label_value = `${/*selectedOption*/
1026
+ ctx[1] === /*option*/
1027
+ ctx[12].id ? "Selected option" : "Option"} ${useMCQ_default(
1006
1028
  /*index*/
1007
1029
  ctx[14]
1008
1030
  )}: ${/*option*/
@@ -1025,6 +1047,16 @@
1025
1047
  p(new_ctx, dirty) {
1026
1048
  ctx = new_ctx;
1027
1049
  if (dirty & /*selectedOption*/
1050
+ 2 && button_aria_label_value !== (button_aria_label_value = `${/*selectedOption*/
1051
+ ctx[1] === /*option*/
1052
+ ctx[12].id ? "Selected option" : "Option"} ${useMCQ_default(
1053
+ /*index*/
1054
+ ctx[14]
1055
+ )}: ${/*option*/
1056
+ ctx[12].answer}`)) {
1057
+ attr(button, "aria-label", button_aria_label_value);
1058
+ }
1059
+ if (dirty & /*selectedOption*/
1028
1060
  2 && button_class_value !== (button_class_value = "btn-mcq-option group text-left " + /*selectedOption*/
1029
1061
  (ctx[1] === /*option*/
1030
1062
  ctx[12].id ? "selected" : ""))) {
@@ -1042,53 +1074,60 @@
1042
1074
  }
1043
1075
  function create_fragment(ctx) {
1044
1076
  let div1;
1045
- let p0;
1046
- let t1;
1047
- let p1;
1048
- let t3;
1077
+ let t0;
1078
+ let p;
1079
+ let t2;
1049
1080
  let div0;
1050
- let t4;
1051
- let if_block = (
1081
+ let t3;
1082
+ let if_block0 = (
1083
+ /*rubric*/
1084
+ ctx[2].text && create_if_block_1(ctx)
1085
+ );
1086
+ let if_block1 = (
1052
1087
  /*options*/
1053
1088
  ctx[4] && create_if_block(ctx)
1054
1089
  );
1055
1090
  return {
1056
1091
  c() {
1057
1092
  div1 = element("div");
1058
- p0 = element("p");
1059
- p0.textContent = `${/*rubric*/
1060
- ctx[2].text}`;
1061
- t1 = space();
1062
- p1 = element("p");
1063
- p1.textContent = `${/*prompt*/
1093
+ if (if_block0)
1094
+ if_block0.c();
1095
+ t0 = space();
1096
+ p = element("p");
1097
+ p.textContent = `${/*prompt*/
1064
1098
  ctx[3]}`;
1065
- t3 = space();
1099
+ t2 = space();
1066
1100
  div0 = element("div");
1067
- t4 = space();
1068
- if (if_block)
1069
- if_block.c();
1070
- attr(p0, "class", "h5 mb-2 md:mb-4");
1071
- attr(p1, "class", "h5 font-semibold");
1101
+ t3 = space();
1102
+ if (if_block1)
1103
+ if_block1.c();
1104
+ attr(p, "class", "h5 font-semibold");
1072
1105
  attr(div0, "class", "divider my-6");
1073
1106
  attr(div1, "class", "bg-transparent");
1074
1107
  },
1075
1108
  m(target, anchor) {
1076
1109
  insert(target, div1, anchor);
1077
- append(div1, p0);
1078
- append(div1, t1);
1079
- append(div1, p1);
1080
- append(div1, t3);
1110
+ if (if_block0)
1111
+ if_block0.m(div1, null);
1112
+ append(div1, t0);
1113
+ append(div1, p);
1114
+ append(div1, t2);
1081
1115
  append(div1, div0);
1082
- append(div1, t4);
1083
- if (if_block)
1084
- if_block.m(div1, null);
1116
+ append(div1, t3);
1117
+ if (if_block1)
1118
+ if_block1.m(div1, null);
1085
1119
  },
1086
1120
  p(ctx2, [dirty]) {
1121
+ if (
1122
+ /*rubric*/
1123
+ ctx2[2].text
1124
+ )
1125
+ if_block0.p(ctx2, dirty);
1087
1126
  if (
1088
1127
  /*options*/
1089
1128
  ctx2[4]
1090
1129
  )
1091
- if_block.p(ctx2, dirty);
1130
+ if_block1.p(ctx2, dirty);
1092
1131
  },
1093
1132
  i: noop,
1094
1133
  o: noop,
@@ -1096,8 +1135,10 @@
1096
1135
  if (detaching) {
1097
1136
  detach(div1);
1098
1137
  }
1099
- if (if_block)
1100
- if_block.d();
1138
+ if (if_block0)
1139
+ if_block0.d();
1140
+ if (if_block1)
1141
+ if_block1.d();
1101
1142
  }
1102
1143
  };
1103
1144
  }
@@ -1219,7 +1260,7 @@
1219
1260
  }
1220
1261
  };
1221
1262
  }
1222
- function create_if_block_1(ctx) {
1263
+ function create_if_block_12(ctx) {
1223
1264
  let promptmcq;
1224
1265
  let current;
1225
1266
  promptmcq = new PromptMCQ_default({
@@ -1307,7 +1348,7 @@
1307
1348
  let if_block;
1308
1349
  let if_block_anchor;
1309
1350
  let current;
1310
- const if_block_creators = [create_if_block2, create_if_block_1, create_else_block];
1351
+ const if_block_creators = [create_if_block2, create_if_block_12, create_else_block];
1311
1352
  const if_blocks = [];
1312
1353
  function select_block_type(ctx2, dirty) {
1313
1354
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Authoring tool frontend SDK",
5
5
  "contributors": [
6
6
  {