eat-js-sdk 2.0.24 → 2.0.26

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.
@@ -14052,28 +14052,21 @@ var root$5 = /* @__PURE__ */ from_html(`<!> <section role="group" aria-dropeffe
14052
14052
  function CategoriseDndContainer($$anchor, $$props) {
14053
14053
  push($$props, true);
14054
14054
  let containerId = prop($$props, "containerId", 7), containerClass = prop($$props, "containerClass", 7, ""), showButton = prop($$props, "showButton", 7, true), items = prop($$props, "items", 23, () => []), selectedItemId = prop($$props, "selectedItemId", 7, void 0), isLocked = prop($$props, "isLocked", 7, false), currentTabContainer = prop($$props, "currentTabContainer", 7, null), isMobile = prop($$props, "isMobile", 7, false), mode = prop($$props, "mode", 7), paddingTop = prop($$props, "paddingTop", 7, 0), dndType = prop($$props, "dndType", 7, "categorise"), onitemdrop = prop($$props, "onitemdrop", 7), onitemselect = prop($$props, "onitemselect", 7), oncontainerclick = prop($$props, "oncontainerclick", 7), onitemkeydown = prop($$props, "onitemkeydown", 7), ondraghover = prop($$props, "ondraghover", 7), ondragstart = prop($$props, "ondragstart", 7), children = prop($$props, "children", 7);
14055
- let dndItems = /* @__PURE__ */ state(proxy([]));
14056
14055
  let considerItemId = /* @__PURE__ */ state(void 0);
14057
14056
  let isHoveringDrag = /* @__PURE__ */ state(false);
14058
- user_effect(() => {
14059
- set(
14060
- dndItems,
14061
- items().map((item) => {
14062
- if (item.id === get$1(considerItemId)) {
14063
- return {
14064
- id: "clonedId",
14065
- itemText: item.itemText,
14066
- isClonedItem: true,
14067
- cloneId: item.id
14068
- };
14069
- }
14070
- return { ...item };
14071
- }),
14072
- true
14073
- );
14074
- });
14057
+ const dndItems = /* @__PURE__ */ user_derived(() => items().map((item) => {
14058
+ if (item.id === get$1(considerItemId)) {
14059
+ return {
14060
+ id: "clonedId",
14061
+ itemText: item.itemText,
14062
+ isClonedItem: true,
14063
+ cloneId: item.id
14064
+ };
14065
+ }
14066
+ return { ...item };
14067
+ }));
14075
14068
  const handleConsider = (e2) => {
14076
- const { items: newItems, info } = e2.detail;
14069
+ const { info } = e2.detail;
14077
14070
  if (info.trigger === "draggedEntered") {
14078
14071
  set(isHoveringDrag, true);
14079
14072
  if (ondraghover()) {
@@ -14096,16 +14089,15 @@ function CategoriseDndContainer($$anchor, $$props) {
14096
14089
  }
14097
14090
  return;
14098
14091
  }
14099
- if (get$1(considerItemId) && !get$1(isHoveringDrag)) {
14100
- set(dndItems, newItems, true);
14092
+ if (info.trigger === "droppedOutsideOfAny" || info.trigger === "dragStopped") {
14093
+ set(considerItemId, void 0);
14094
+ set(isHoveringDrag, false);
14095
+ return;
14101
14096
  }
14102
14097
  };
14103
14098
  const handleFinalize = (e2) => {
14104
- const { items: newItems } = e2.detail;
14105
14099
  set(considerItemId, void 0);
14106
14100
  set(isHoveringDrag, false);
14107
- const filteredItems = newItems.filter((item) => !item.isClonedItem);
14108
- set(dndItems, filteredItems, true);
14109
14101
  if (onitemdrop()) {
14110
14102
  onitemdrop()(e2);
14111
14103
  }
@@ -14388,6 +14380,9 @@ function CategoriseDndContainer($$anchor, $$props) {
14388
14380
  get mode() {
14389
14381
  return mode();
14390
14382
  },
14383
+ get isCurrentMobileItem() {
14384
+ return isMobile();
14385
+ },
14391
14386
  get resultType() {
14392
14387
  return get$1(itemResultType);
14393
14388
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "change version": "2.0.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [