blixify-ui-web-mcp 0.1.26 → 0.1.28

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.
@@ -9,6 +9,13 @@ import { Button } from "../../action/button";
9
9
  import { Loading } from "../../display/loading";
10
10
  import { DataWrapperTestSchema } from "./dataWrapper.fixtures";
11
11
  import { DataTemplateWrapper } from "./index";
12
+ import {
13
+ STORY_API_ENDPOINT,
14
+ STORY_NAMES,
15
+ handleBuildStoryRecords,
16
+ storyWorkspace,
17
+ useStoryBackend,
18
+ } from "./storyBackend.fixtures";
12
19
  import { MarkdownInput } from "../../input/markdown";
13
20
 
14
21
  const meta = {
@@ -24,21 +31,23 @@ const meta = {
24
31
 
25
32
  export default meta;
26
33
 
27
- // INFO: Story to test imageTagToggleMode + imageHideEnabled across 3 role views:
28
- // - Installer: no props, sees all photos
29
- // - Customer: imageHideEnabled=true, hidden photos filtered out in read view
30
- // - PE: imageTagToggleMode=true, eye icon to toggle hidden flag, read shows all
31
-
34
+ // INFO: the e2e CRUD spec answers this story's requests with page.route, so the
35
+ // story backend stands aside under Playwright
32
36
  export const DataWrapperTest = () => {
33
- const [mount, setMount] = useState<boolean>(false);
37
+ const mount = useStoryBackend({
38
+ collections: {
39
+ "dtw-test-collection": handleBuildStoryRecords(12, (index) => ({
40
+ _id: `checklist-${index}`,
41
+ clientName: STORY_NAMES[index % STORY_NAMES.length],
42
+ clientPhone: `01${2000000 + index * 1379}`,
43
+ address: `${index} Jalan Contoh, 50450 Kuala Lumpur`,
44
+ })),
45
+ },
46
+ yieldToE2E: true,
47
+ });
34
48
  const dataRefreshRef: any = useRef(null);
35
49
  const [viewType, setViewType] = useState<"list" | "read" | "update">("list");
36
50
  const [selectedId, setSelectedId] = useState<string | undefined>(undefined);
37
- const dtwBaseUrl = "http://localhost:3000";
38
-
39
- useEffect(() => {
40
- setMount(true);
41
- }, []);
42
51
 
43
52
  // INFO: no second handleRefresh effect — ReadQueryHoc auto-fetches on mount.
44
53
  // A manual refresh here only causes a visible double-loading flash and pads
@@ -58,8 +67,8 @@ export const DataWrapperTest = () => {
58
67
  <div className="font-semibold mb-1 text-gray-900">DTW Test</div>
59
68
  <div className="text-sm font-light mb-4 text-gray-500">
60
69
  Minimal 3-field DataTemplateWrapper story used by the e2e CRUD spec.
61
- Validates create, read, update, and delete against the configured
62
- backend without optional schema fields blocking submission.
70
+ Create, read, update and delete run against the in-memory story backend,
71
+ with no required fields blocking submission.
63
72
  </div>
64
73
  <DataTemplateWrapper
65
74
  ref={dataRefreshRef}
@@ -68,15 +77,7 @@ export const DataWrapperTest = () => {
68
77
  id={selectedId}
69
78
  collectionId={"dtw-test-collection"}
70
79
  schema={DataWrapperTestSchema}
71
- workspace={{
72
- apiEndpointType: "mongoDB",
73
- apiEndpoint: `${dtwBaseUrl}/api/data`,
74
- apiEndpointToken: "",
75
- apiUserToken: "",
76
- assetEndpoint:
77
- "https://firebasestorage.googleapis.com/v0/b/demo-bucket.firebasestorage.app/o/",
78
- assetUploadEndpoint: `${dtwBaseUrl}/api/asset`,
79
- }}
80
+ workspace={storyWorkspace()}
80
81
  edit={{
81
82
  allEditable: true,
82
83
  disabledUpdate: false,
@@ -600,9 +601,9 @@ export const DTWEmbeddedInMarkdown = () => {
600
601
  A real DataTemplateWrapper rendered inside a note through
601
602
  MarkdownInput&apos;s renderEmbed, with the flags Space sets on an embed:
602
603
  bareAddColumns, bareFlatTable, listAddable, listEditable and readDrawer.
603
- Add a column from the header, add a row inline, then check the header and
604
- the rows still line up and that no cell reads &quot;div&quot;. New rows
605
- are stored as drafts, which is what puts a React element in a cell.
604
+ Add a column from the header, add a row inline, then check the header
605
+ and the rows still line up and that no cell reads &quot;div&quot;. New
606
+ rows are stored as drafts, which is what puts a React element in a cell.
606
607
  </div>
607
608
  <MarkdownInput
608
609
  id="notes"
@@ -624,7 +625,7 @@ export const DTWEmbeddedInMarkdown = () => {
624
625
  // listObjectTableView is what selects the table; leave it off and the field
625
626
  // renders as a List.
626
627
 
627
- const LIST_OBJECT_ENDPOINT = "http://localhost:3000/api/data";
628
+ const LIST_OBJECT_ENDPOINT = STORY_API_ENDPOINT;
628
629
  const LIST_OBJECT_COLLECTION = "dtw-list-object-table";
629
630
 
630
631
  // INFO: tabIds on purpose — the action pill only renders its Previous/Next
@@ -701,7 +702,10 @@ export const DTWListObjectTable = () => {
701
702
  .onPost(`${LIST_OBJECT_ENDPOINT}/${LIST_OBJECT_COLLECTION}/get`)
702
703
  .reply((config) => {
703
704
  const body = handleParseBody(config);
704
- return [200, { data: store.find((row) => row._id === body.id) ?? null }];
705
+ return [
706
+ 200,
707
+ { data: store.find((row) => row._id === body.id) ?? null },
708
+ ];
705
709
  });
706
710
 
707
711
  mock
@@ -709,7 +713,8 @@ export const DTWListObjectTable = () => {
709
713
  .reply((config) => {
710
714
  const body = handleParseBody(config);
711
715
  const index = store.findIndex((row) => row._id === body.id);
712
- if (index >= 0) store[index] = { ...store[index], ...(body.data ?? {}) };
716
+ if (index >= 0)
717
+ store[index] = { ...store[index], ...(body.data ?? {}) };
713
718
  return [200, { success: body.id ?? true }];
714
719
  });
715
720