@flamingo-stack/openframe-frontend-core 0.0.586-snapshot.20260903151444 → 0.0.586
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/{chunk-F3YRPKUA.js → chunk-2Y5UT5VF.js} +2 -2
- package/dist/{chunk-3PDTGDOA.js → chunk-3HYHYKNL.js} +4 -4
- package/dist/{chunk-SVR75PFW.js → chunk-3JVYM4ZN.js} +5 -5
- package/dist/{chunk-DMQMRFGS.cjs → chunk-3WR5R6H6.cjs} +16 -16
- package/dist/{chunk-DMQMRFGS.cjs.map → chunk-3WR5R6H6.cjs.map} +1 -1
- package/dist/{chunk-MF7TMFVB.cjs → chunk-4VZFJKPT.cjs} +3 -3
- package/dist/{chunk-MF7TMFVB.cjs.map → chunk-4VZFJKPT.cjs.map} +1 -1
- package/dist/{chunk-VWNU2PFX.js → chunk-5OIXAV4P.js} +2 -2
- package/dist/{chunk-R2U2D7LU.js → chunk-6EZGJZVH.js} +2 -2
- package/dist/{chunk-DTQCZ6AR.cjs → chunk-6ZNWY6WW.cjs} +17 -17
- package/dist/{chunk-DTQCZ6AR.cjs.map → chunk-6ZNWY6WW.cjs.map} +1 -1
- package/dist/{chunk-UBSIENYF.cjs → chunk-A6ETQEWK.cjs} +2 -4
- package/dist/chunk-A6ETQEWK.cjs.map +1 -0
- package/dist/{chunk-KQ5JQVYL.cjs → chunk-BMORFCT2.cjs} +34 -34
- package/dist/{chunk-KQ5JQVYL.cjs.map → chunk-BMORFCT2.cjs.map} +1 -1
- package/dist/{chunk-5O5JMGEN.cjs → chunk-C3MRLZUI.cjs} +33 -33
- package/dist/{chunk-5O5JMGEN.cjs.map → chunk-C3MRLZUI.cjs.map} +1 -1
- package/dist/{chunk-YB5DFQKD.js → chunk-DQUEVRDU.js} +5 -5
- package/dist/{chunk-3FHWLQDG.cjs → chunk-EAYMX22G.cjs} +10 -10
- package/dist/{chunk-3FHWLQDG.cjs.map → chunk-EAYMX22G.cjs.map} +1 -1
- package/dist/{chunk-BLJEPNMJ.js → chunk-KLWJRGNN.js} +3 -3
- package/dist/{chunk-LODCKZ72.js → chunk-L4WLYGB4.js} +2 -2
- package/dist/{chunk-SI57FQZ2.js → chunk-LV6CORVJ.js} +2 -2
- package/dist/{chunk-4IIFSFJ3.cjs → chunk-M36XSGZV.cjs} +13 -13
- package/dist/{chunk-4IIFSFJ3.cjs.map → chunk-M36XSGZV.cjs.map} +1 -1
- package/dist/{chunk-MXCWOMNT.cjs → chunk-NISAGFEM.cjs} +3 -3
- package/dist/{chunk-MXCWOMNT.cjs.map → chunk-NISAGFEM.cjs.map} +1 -1
- package/dist/{chunk-7WIKOL25.cjs → chunk-NYLWMAHP.cjs} +4 -4
- package/dist/{chunk-7WIKOL25.cjs.map → chunk-NYLWMAHP.cjs.map} +1 -1
- package/dist/{chunk-6BFEJXMI.js → chunk-OZNFPQT5.js} +2 -2
- package/dist/{chunk-A5PXHMCJ.cjs → chunk-P2CKLIOM.cjs} +49 -49
- package/dist/{chunk-A5PXHMCJ.cjs.map → chunk-P2CKLIOM.cjs.map} +1 -1
- package/dist/{chunk-V4WUSOGS.js → chunk-PLMJVA2H.js} +2 -2
- package/dist/{chunk-XNEPABUD.cjs → chunk-QZYYNBMI.cjs} +17 -17
- package/dist/{chunk-XNEPABUD.cjs.map → chunk-QZYYNBMI.cjs.map} +1 -1
- package/dist/{chunk-OKD7MX7Y.js → chunk-S7YXLZNG.js} +4 -4
- package/dist/{chunk-WQXWH7LF.cjs → chunk-SSGM2NKA.cjs} +4 -4
- package/dist/{chunk-WQXWH7LF.cjs.map → chunk-SSGM2NKA.cjs.map} +1 -1
- package/dist/{chunk-IGBNEPTD.cjs → chunk-V7ZJTUV2.cjs} +3 -3
- package/dist/{chunk-IGBNEPTD.cjs.map → chunk-V7ZJTUV2.cjs.map} +1 -1
- package/dist/{chunk-E7NFHRLX.cjs → chunk-XMK24INA.cjs} +3 -3
- package/dist/{chunk-E7NFHRLX.cjs.map → chunk-XMK24INA.cjs.map} +1 -1
- package/dist/{chunk-436G4DI4.js → chunk-XMTGLQSD.js} +2 -2
- package/dist/{chunk-P24OI2CD.js → chunk-YEQAA6I4.js} +2 -2
- package/dist/{chunk-HCWZP44O.js → chunk-YYC7V7YC.js} +2 -4
- package/dist/{chunk-HCWZP44O.js.map → chunk-YYC7V7YC.js.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +29 -29
- package/dist/components/index.js +12 -12
- package/dist/components/meeting-scheduler/index.cjs +18 -18
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/data-table/use-data-table.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/components/ui/data-table/use-data-table.ts +1 -36
- package/dist/chunk-UBSIENYF.cjs.map +0 -1
- package/src/components/ui/__tests__/data-table-compiler-identity.test.tsx +0 -74
- /package/dist/{chunk-F3YRPKUA.js.map → chunk-2Y5UT5VF.js.map} +0 -0
- /package/dist/{chunk-3PDTGDOA.js.map → chunk-3HYHYKNL.js.map} +0 -0
- /package/dist/{chunk-SVR75PFW.js.map → chunk-3JVYM4ZN.js.map} +0 -0
- /package/dist/{chunk-VWNU2PFX.js.map → chunk-5OIXAV4P.js.map} +0 -0
- /package/dist/{chunk-R2U2D7LU.js.map → chunk-6EZGJZVH.js.map} +0 -0
- /package/dist/{chunk-YB5DFQKD.js.map → chunk-DQUEVRDU.js.map} +0 -0
- /package/dist/{chunk-BLJEPNMJ.js.map → chunk-KLWJRGNN.js.map} +0 -0
- /package/dist/{chunk-LODCKZ72.js.map → chunk-L4WLYGB4.js.map} +0 -0
- /package/dist/{chunk-SI57FQZ2.js.map → chunk-LV6CORVJ.js.map} +0 -0
- /package/dist/{chunk-6BFEJXMI.js.map → chunk-OZNFPQT5.js.map} +0 -0
- /package/dist/{chunk-V4WUSOGS.js.map → chunk-PLMJVA2H.js.map} +0 -0
- /package/dist/{chunk-OKD7MX7Y.js.map → chunk-S7YXLZNG.js.map} +0 -0
- /package/dist/{chunk-436G4DI4.js.map → chunk-XMTGLQSD.js.map} +0 -0
- /package/dist/{chunk-P24OI2CD.js.map → chunk-YEQAA6I4.js.map} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { ColumnDef, Table } from '@tanstack/react-table';
|
|
2
|
-
import { render, renderHook, screen } from '@testing-library/react';
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
import { DataTable } from '../data-table';
|
|
6
|
-
import { useDataTable } from '../data-table/use-data-table';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* What this pins down: `useDataTable` must hand back a NEW reference on every
|
|
10
|
-
* render, because `useReactTable` creates one instance for the life of the
|
|
11
|
-
* component and mutates it in place.
|
|
12
|
-
*
|
|
13
|
-
* Everything inside `<DataTable>` reads its rows back out of that instance
|
|
14
|
-
* through context, so a caller compiled by the React Compiler caches
|
|
15
|
-
* `<DataTable table={table}>` and its children on the table's identity — which
|
|
16
|
-
* never changes — and a table that gains rows renders nothing new. On an
|
|
17
|
-
* infinite-scroll table that is a request loop: the sentinel never moves down,
|
|
18
|
-
* so `DataTable.InfiniteFooter` keeps asking for the next page.
|
|
19
|
-
*
|
|
20
|
-
* `CachedTable` below stands in for that compiled caller. `memo` bails out on
|
|
21
|
-
* identical props exactly like the compiler's `if ($[n] !== table)` guard.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
interface Row {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const COLUMNS: ColumnDef<Row>[] = [{ accessorKey: 'name', header: 'Name', cell: ({ row }) => row.original.name }];
|
|
30
|
-
|
|
31
|
-
const getRowId = (row: Row) => row.id;
|
|
32
|
-
|
|
33
|
-
function rows(count: number): Row[] {
|
|
34
|
-
return Array.from({ length: count }, (_, i) => ({ id: `r${i}`, name: `row-${i}` }));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const CachedTable = memo(function CachedTableImpl({ table }: { table: Table<Row> }) {
|
|
38
|
-
return (
|
|
39
|
-
<DataTable table={table}>
|
|
40
|
-
<DataTable.Body<Row> />
|
|
41
|
-
</DataTable>
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
function TableHost({ data }: { data: Row[] }) {
|
|
46
|
-
const table = useDataTable<Row>({ data, columns: COLUMNS, getRowId });
|
|
47
|
-
return <CachedTable table={table} />;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
describe('useDataTable identity', () => {
|
|
51
|
-
it('lets a consumer memoized on the table render rows that arrived later', () => {
|
|
52
|
-
const { rerender } = render(<TableHost data={rows(2)} />);
|
|
53
|
-
expect(screen.getAllByText(/^row-\d$/)).toHaveLength(2);
|
|
54
|
-
|
|
55
|
-
rerender(<TableHost data={rows(4)} />);
|
|
56
|
-
expect(screen.getAllByText(/^row-\d$/)).toHaveLength(4);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('forwards reads and writes to the single underlying instance', () => {
|
|
60
|
-
const { result, rerender } = renderHook(({ data }) => useDataTable<Row>({ data, columns: COLUMNS, getRowId }), {
|
|
61
|
-
initialProps: { data: rows(3) },
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const first = result.current;
|
|
65
|
-
expect(first.getRowModel().rows).toHaveLength(3);
|
|
66
|
-
// A write through one handle must be visible through the next one.
|
|
67
|
-
first.setOptions(prev => ({ ...prev, meta: { probed: true } }));
|
|
68
|
-
|
|
69
|
-
rerender({ data: rows(5) });
|
|
70
|
-
expect(result.current).not.toBe(first);
|
|
71
|
-
expect(result.current.getRowModel().rows).toHaveLength(5);
|
|
72
|
-
expect(result.current.options.meta).toEqual({ probed: true });
|
|
73
|
-
});
|
|
74
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|