@multiplatform.one/backoffice 8.1.0 → 8.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/backoffice",
3
- "version": "8.1.0",
3
+ "version": "8.2.1",
4
4
  "description": "Embeddable Frappe desk recreation (backoffice) for the multiplatform.one stack",
5
5
  "keywords": [
6
6
  "backoffice",
@@ -71,20 +71,20 @@
71
71
  "access": "public"
72
72
  },
73
73
  "dependencies": {
74
- "@multiplatform.one/components": "^8.1.0",
75
- "@multiplatform.one/forms": "^8.1.0",
76
- "@multiplatform.one/frappe": "^8.1.0",
77
- "@multiplatform.one/frappe-ui": "^8.1.0",
78
- "@multiplatform.one/platform": "^8.1.0",
79
- "@multiplatform.one/store": "^8.1.0",
80
- "@multiplatform.one/table": "^8.1.0",
81
- "@multiplatform.one/theme": "^8.1.0",
74
+ "@multiplatform.one/components": "^8.2.1",
75
+ "@multiplatform.one/forms": "^8.2.1",
76
+ "@multiplatform.one/frappe": "^8.2.1",
77
+ "@multiplatform.one/frappe-ui": "^8.2.1",
78
+ "@multiplatform.one/platform": "^8.2.1",
79
+ "@multiplatform.one/store": "^8.2.1",
80
+ "@multiplatform.one/table": "^8.2.1",
81
+ "@multiplatform.one/theme": "^8.2.1",
82
82
  "@phosphor-icons/react": "^2.1.10",
83
83
  "tamagui": "2.7.6"
84
84
  },
85
85
  "devDependencies": {
86
- "@multiplatform.one/config": "8.1.0",
87
- "@multiplatform.one/test-utils": "8.1.0",
86
+ "@multiplatform.one/config": "8.2.1",
87
+ "@multiplatform.one/test-utils": "8.2.1",
88
88
  "@tamagui/build": "2.7.6",
89
89
  "@testing-library/react": "^16.3.3",
90
90
  "@types/react-dom": "^19.2.3",
@@ -66,21 +66,7 @@ function renderCanvas({
66
66
  return { seen, names, onTab, onSelect, onAdd };
67
67
  }
68
68
 
69
- const sectionMenu = { Untitled: 0, Stats: 1 } as const;
70
-
71
- function menuButton(menu: string) {
72
- const [kind, name] = menu.startsWith("Menu for section ")
73
- ? ([
74
- "Menu for section {{section}}",
75
- sectionMenu[menu.slice(17).split(" ")[0] as "Stats"],
76
- ] as const)
77
- : (["Menu for {{field}}", menu.slice(9).toLowerCase()] as const);
78
- if (typeof name === "string") {
79
- const card = document.querySelector<HTMLElement>(`[data-fb-fieldname="${name}"]`)!;
80
- return within(card).getByRole("button", { name: kind });
81
- }
82
- return screen.getAllByRole("button", { name: kind })[name];
83
- }
69
+ const menuButton = (menu: string) => screen.getByRole("button", { name: menu });
84
70
 
85
71
  async function pick(menu: string, item: string) {
86
72
  fireEvent.click(menuButton(menu));
@@ -287,13 +287,17 @@ describe("form builder keyboard drag", () => {
287
287
  expect(ignored.preventDefault).not.toHaveBeenCalled();
288
288
  act(() => test.result.current.keyDown(card, key("Enter")));
289
289
  expect(test.result.current.drag).toMatchObject({ mode: "keyboard" });
290
- expect(test.result.current.announcement).toMatch(/^Lifted /);
290
+ expect(test.result.current.announcement).toBe(
291
+ "Lifted First in Untitled section, column 1, position 1 of 1. Use arrow keys to move, space to drop, escape to cancel.",
292
+ );
291
293
  const stray = key("Tab");
292
294
  act(() => test.result.current.keyDown(card, stray));
293
295
  expect(stray.preventDefault).not.toHaveBeenCalled();
294
296
  act(() => test.result.current.keyDown(card, key("ArrowRight")));
295
297
  expect(test.result.current.drag?.target.columnId).toBe(test.second.key);
296
- expect(test.result.current.announcement).toMatch(/^Moved /);
298
+ expect(test.result.current.announcement).toBe(
299
+ "Moved First to Untitled section, column 2, position 1 of 2.",
300
+ );
297
301
  act(() => test.result.current.keyDown(card, key(" ")));
298
302
  expect(test.result.current.drag).toBeNull();
299
303
  const moved = test.onChange.mock.calls[0][0].tabs[0].sections[0].columns;
@@ -308,7 +312,9 @@ describe("form builder keyboard drag", () => {
308
312
  expect(test.result.current.drag).not.toBeNull();
309
313
  act(() => window.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })));
310
314
  expect(test.result.current.drag).toBeNull();
311
- expect(test.result.current.announcement).toMatch(/^Movement cancelled/);
315
+ expect(test.result.current.announcement).toBe(
316
+ "Movement cancelled. First returned to Untitled section, column 1.",
317
+ );
312
318
  expect(test.onChange).not.toHaveBeenCalled();
313
319
  });
314
320