@jini-ai/admin 0.3.0 → 0.3.7
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/README.md +7 -4
- package/dist/core/data-table/types.d.ts +14 -0
- package/dist/core/data-table/types.d.ts.map +1 -0
- package/dist/core/data-table/types.js +8 -0
- package/dist/core/data-table/types.js.map +1 -0
- package/dist/core/entities/rules.d.ts +138 -0
- package/dist/core/entities/rules.d.ts.map +1 -0
- package/dist/core/entities/rules.js +344 -0
- package/dist/core/entities/rules.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/ports/entities.d.ts +302 -0
- package/dist/core/ports/entities.d.ts.map +1 -0
- package/dist/core/ports/entities.js +47 -0
- package/dist/core/ports/entities.js.map +1 -0
- package/dist/core/ports/index.d.ts +1 -0
- package/dist/core/ports/index.d.ts.map +1 -1
- package/dist/core/ports/menus.d.ts +43 -0
- package/dist/core/ports/menus.d.ts.map +1 -1
- package/dist/core/ports/menus.js +43 -0
- package/dist/core/ports/menus.js.map +1 -1
- package/dist/react/components/DataTable.d.ts +70 -8
- package/dist/react/components/DataTable.d.ts.map +1 -1
- package/dist/react/components/DataTable.js +58 -2
- package/dist/react/components/DataTable.js.map +1 -1
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +1 -1
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts.map +1 -1
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +13 -12
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js.map +1 -1
- package/dist/react/components/Sidebar.d.ts.map +1 -1
- package/dist/react/components/Sidebar.js +90 -2
- package/dist/react/components/Sidebar.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DataTableSortDirection, DataTableSortState } from '../../core/data-table/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* @file The admin list table.
|
|
4
5
|
*
|
|
@@ -12,16 +13,37 @@ import type { ReactNode } from 'react';
|
|
|
12
13
|
*
|
|
13
14
|
* What the corpus did **not** contain is just as load-bearing:
|
|
14
15
|
*
|
|
15
|
-
* - **No sorting.** Zero of 25.
|
|
16
16
|
* - **No pagination.** Zero of 25.
|
|
17
17
|
* - **No row selection.** Zero of 25 — the checkboxes that appear inside some of those tables are
|
|
18
18
|
* field controls belonging to the row's own data, not a selection model.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* Pagination and row selection stay cut for the same reason sorting originally was: nobody in the
|
|
21
|
+
* corpus asked for either, and guessing at their shape (page-size defaults, single- vs. multi-select)
|
|
22
|
+
* would be a compatibility obligation nobody has paid for yet.
|
|
23
|
+
*
|
|
24
|
+
* ## Sorting (added once two hosts needed it)
|
|
25
|
+
*
|
|
26
|
+
* Sorting **did** ship — this component's own history is the case study for the plan above. Posts
|
|
27
|
+
* and Pages both hand-rolled an identical click-to-sort header (a button, a caret, an `aria-label`
|
|
28
|
+
* carrying the accessible state) because this component had nowhere to put it, and more screens were
|
|
29
|
+
* about to make it a third and fourth copy. The three guesses the original cut worried about each
|
|
30
|
+
* resolved to something concrete once real callers existed:
|
|
31
|
+
*
|
|
32
|
+
* - **Comparator semantics** — a column that wants to sort supplies
|
|
33
|
+
* {@link DataTableColumnSort.compare}, an ascending-order comparator exactly like `Array#sort`'s
|
|
34
|
+
* own contract. `DataTable` negates it for `"desc"` rather than taking two functions — a column's
|
|
35
|
+
* ordering is one relation, not two.
|
|
36
|
+
* - **Controlled vs. uncontrolled** — controlled, via {@link DataTableProps.sort} and
|
|
37
|
+
* {@link DataTableProps.onSortChange}. `DataTable` holds no sort state of its own: direction is
|
|
38
|
+
* transient view state the owning screen already held before this existed, and centralizing the
|
|
39
|
+
* comparator/caret/`aria-sort` plumbing does not change who owns that state.
|
|
40
|
+
* - **Multi-column precedence** — not built. Exactly one column sorts at a time: activating a
|
|
41
|
+
* different sortable column's header replaces the active one outright; activating the same
|
|
42
|
+
* column's header again toggles its direction. Nobody asked for combined multi-column sort.
|
|
43
|
+
*
|
|
44
|
+
* A column that omits {@link DataTableColumn.sort} renders its `<th>` exactly as it always has — no
|
|
45
|
+
* button, no caret, no `aria-sort` — so every existing caller that never mentions sorting sees no
|
|
46
|
+
* change at all.
|
|
25
47
|
*
|
|
26
48
|
* `<tfoot>` appeared exactly once, so it is an optional prop rather than part of the core shape.
|
|
27
49
|
*
|
|
@@ -42,8 +64,30 @@ import type { ReactNode } from 'react';
|
|
|
42
64
|
* a wide table scroll instead of breaking the page, and it is also why `RowMenu` portals its popup
|
|
43
65
|
* out to `document.body` rather than positioning inside this box.
|
|
44
66
|
*/
|
|
67
|
+
export type { DataTableSortDirection, DataTableSortState };
|
|
68
|
+
/** Enables click-to-sort on one column (`DataTableColumn.sort`). Everything a host needs to decide
|
|
69
|
+
* is here; `DataTable` only wires the click, renders the caret, and sets `aria-sort`. */
|
|
70
|
+
export interface DataTableColumnSort<Row> {
|
|
71
|
+
/** Ascending-order comparator, exactly like `Array#sort`'s own contract. `DataTable` negates its
|
|
72
|
+
* result when the active direction is `"desc"` rather than asking for a second function — a
|
|
73
|
+
* column's ordering is one relation, not two. Reach for `Date.parse` on an ISO-8601 **text**
|
|
74
|
+
* column (never a plain string compare — that breaks the moment a non-`Z` UTC-offset value shows
|
|
75
|
+
* up) and `localeCompare` for free text. */
|
|
76
|
+
compare: (a: Row, b: Row) => number;
|
|
77
|
+
/** Direction this column starts at the first time it becomes active — a click while a DIFFERENT
|
|
78
|
+
* column was active, or the first sort of a session. Defaults to `"asc"`; override for a column
|
|
79
|
+
* whose natural first read runs the other way, e.g. a date column's "newest first". Has no effect
|
|
80
|
+
* on the same column's own toggle, which always flips. */
|
|
81
|
+
defaultDirection?: DataTableSortDirection;
|
|
82
|
+
/** This column's accessible name for every sort state — `direction` is `null` when a different
|
|
83
|
+
* column is currently active. State the current state and what activating the control does next;
|
|
84
|
+
* `DataTable` does not synthesize this from `header`, since `header` may be arbitrary markup with
|
|
85
|
+
* no reliable plain-text form. */
|
|
86
|
+
label: (direction: DataTableSortDirection | null) => string;
|
|
87
|
+
}
|
|
45
88
|
export interface DataTableColumn<Row> {
|
|
46
|
-
/** Stable identity for this column. Not rendered — used as the React key
|
|
89
|
+
/** Stable identity for this column. Not rendered — used as the React key, and as the `column`
|
|
90
|
+
* value in {@link DataTableSortState} when this column is sortable. */
|
|
47
91
|
key: string;
|
|
48
92
|
/** Header content. Omit for a column that carries no visible heading (a row-actions column);
|
|
49
93
|
* supply {@link headerLabel} when you do, so the column is still named for assistive tech. */
|
|
@@ -56,6 +100,9 @@ export interface DataTableColumn<Row> {
|
|
|
56
100
|
headerClassName?: string;
|
|
57
101
|
/** Class on this column's `<td>`. A function receives the row, for per-row variation. */
|
|
58
102
|
cellClassName?: string | ((row: Row, index: number) => string | undefined);
|
|
103
|
+
/** Makes this column's header clickable to sort. Omit for a column that never sorts — its `<th>`
|
|
104
|
+
* renders exactly as it always has, with no button, no caret, and no `aria-sort`. */
|
|
105
|
+
sort?: DataTableColumnSort<Row>;
|
|
59
106
|
}
|
|
60
107
|
export interface DataTableProps<Row> {
|
|
61
108
|
rows: readonly Row[];
|
|
@@ -89,9 +136,24 @@ export interface DataTableProps<Row> {
|
|
|
89
136
|
className?: string;
|
|
90
137
|
/** Appended to `.table-scroll`. */
|
|
91
138
|
scrollClassName?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Controlled sort state: the active column's `key` plus direction, or `null`/`undefined` for "no
|
|
141
|
+
* column is the active sort". `DataTable` never derives or persists this itself — sort direction
|
|
142
|
+
* is transient view state the owning screen already held before this existed; centralizing the
|
|
143
|
+
* comparator/caret/`aria-sort` plumbing here does not change who owns that state.
|
|
144
|
+
*/
|
|
145
|
+
sort?: DataTableSortState | null;
|
|
146
|
+
/**
|
|
147
|
+
* Called with the state a header click produces. Activating a different sortable column's header
|
|
148
|
+
* replaces `sort` outright (single active column — no multi-column precedence); activating the
|
|
149
|
+
* already-active column's header toggles its direction. `DataTable` computes the next value; the
|
|
150
|
+
* host only stores it and passes it back as `sort`.
|
|
151
|
+
*/
|
|
152
|
+
onSortChange?: (next: DataTableSortState) => void;
|
|
92
153
|
}
|
|
93
154
|
/**
|
|
94
|
-
* @complexity O(rows × columns) per render
|
|
155
|
+
* @complexity O(rows × columns) per render for cell rendering, same as always; see
|
|
156
|
+
* {@link sortedTableRows} for the one added cost, paid only when `sort` names an active column.
|
|
95
157
|
*/
|
|
96
158
|
export declare function DataTable<Row>(props: DataTableProps<Row>): import("react").JSX.Element;
|
|
97
159
|
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/react/components/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/react/components/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAIH,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAC;AAE3D;0FAC0F;AAC1F,MAAM,WAAW,mBAAmB,CAAC,GAAG;IACtC;;;;i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CAAC;IACnB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;4BACwB;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACnD;AAmED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,+BAiExD"}
|
|
@@ -5,7 +5,56 @@ function resolveCellClassName(column, row, index) {
|
|
|
5
5
|
: column.cellClassName;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* `rows` in display order: unchanged when there is no active sort, or the active column declares no
|
|
9
|
+
* `sort` of its own (defensive against a stale `sort.column` naming a column that no longer exists,
|
|
10
|
+
* or never did). A fresh array is only allocated on the path that actually sorts, so the 20+ callers
|
|
11
|
+
* with no `sort` prop at all pay nothing beyond the `Array#find`.
|
|
12
|
+
*
|
|
13
|
+
* @complexity O(columns) to find the active column, plus O(n log n) in `rows.length` when it has a
|
|
14
|
+
* comparator; O(1)/no allocation otherwise.
|
|
15
|
+
*/
|
|
16
|
+
function sortedTableRows(rows, columns, sort) {
|
|
17
|
+
const activeColumn = sort ? columns.find((column) => column.key === sort.column) : undefined;
|
|
18
|
+
if (!sort || !activeColumn?.sort)
|
|
19
|
+
return rows;
|
|
20
|
+
const sign = sort.direction === 'asc' ? 1 : -1;
|
|
21
|
+
const { compare } = activeColumn.sort;
|
|
22
|
+
return [...rows].sort((a, b) => sign * compare(a, b));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The sort state a click on `column`'s header produces: toggles direction when `column` is already
|
|
26
|
+
* active, otherwise switches to it at its own {@link DataTableColumnSort.defaultDirection}.
|
|
27
|
+
*
|
|
28
|
+
* @complexity Time/space: O(1).
|
|
29
|
+
*/
|
|
30
|
+
function nextSortState(current, column) {
|
|
31
|
+
if (current?.column === column.key) {
|
|
32
|
+
return { column: column.key, direction: current.direction === 'asc' ? 'desc' : 'asc' };
|
|
33
|
+
}
|
|
34
|
+
return { column: column.key, direction: column.sort?.defaultDirection ?? 'asc' };
|
|
35
|
+
}
|
|
36
|
+
/** The `aria-sort` value for a sortable `<th>` — the APG table-sorting pattern's `"none"` for a
|
|
37
|
+
* sortable-but-currently-inactive column, so assistive tech still discovers it is sortable. */
|
|
38
|
+
function ariaSortValue(direction) {
|
|
39
|
+
if (direction === 'asc')
|
|
40
|
+
return 'ascending';
|
|
41
|
+
if (direction === 'desc')
|
|
42
|
+
return 'descending';
|
|
43
|
+
return 'none';
|
|
44
|
+
}
|
|
45
|
+
/** The caret glyph for a sortable header. `"⇅"` — a neutral, always-visible both-direction glyph —
|
|
46
|
+
* when `direction` is `null` (not the active sort), so an unsorted column still visibly reads as
|
|
47
|
+
* clickable rather than only revealing that fact after the first click; `"▲"`/`"▼"` once it is.
|
|
48
|
+
* `aria-hidden` at the call site: the real accessible state is the button's `aria-label` plus the
|
|
49
|
+
* `<th>`'s own `aria-sort`, not this glyph. */
|
|
50
|
+
function sortCaretGlyph(direction) {
|
|
51
|
+
if (direction === null)
|
|
52
|
+
return ' ⇅';
|
|
53
|
+
return direction === 'asc' ? ' ▲' : ' ▼';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @complexity O(rows × columns) per render for cell rendering, same as always; see
|
|
57
|
+
* {@link sortedTableRows} for the one added cost, paid only when `sort` names an active column.
|
|
9
58
|
*/
|
|
10
59
|
export function DataTable(props) {
|
|
11
60
|
// Loading wins over empty deliberately: `rows` is legitimately `[]` during a first fetch, and
|
|
@@ -15,6 +64,13 @@ export function DataTable(props) {
|
|
|
15
64
|
return _jsx(_Fragment, { children: props.loadingContent });
|
|
16
65
|
if (!props.loading && props.rows.length === 0 && props.empty !== undefined)
|
|
17
66
|
return _jsx(_Fragment, { children: props.empty });
|
|
18
|
-
|
|
67
|
+
const rows = sortedTableRows(props.rows, props.columns, props.sort);
|
|
68
|
+
return (_jsx("div", { className: ['table-scroll', props.scrollClassName].filter(Boolean).join(' '), children: _jsxs("table", { className: ['list-table', props.className].filter(Boolean).join(' '), "aria-label": props.label, children: [props.caption === undefined ? null : _jsx("caption", { children: props.caption }), _jsx("thead", { children: _jsx("tr", { children: props.columns.map((column) => {
|
|
69
|
+
if (!column.sort) {
|
|
70
|
+
return (_jsx("th", { scope: "col", className: column.headerClassName, "aria-label": column.header === undefined ? column.headerLabel : undefined, children: column.header }, column.key));
|
|
71
|
+
}
|
|
72
|
+
const direction = props.sort?.column === column.key ? props.sort.direction : null;
|
|
73
|
+
return (_jsx("th", { scope: "col", className: column.headerClassName, "aria-sort": ariaSortValue(direction), children: _jsxs("button", { type: "button", className: "sortable-column-header", onClick: () => props.onSortChange?.(nextSortState(props.sort, column)), "aria-label": column.sort.label(direction), children: [column.header, _jsx("span", { "aria-hidden": "true", children: sortCaretGlyph(direction) })] }) }, column.key));
|
|
74
|
+
}) }) }), _jsx("tbody", { children: rows.map((row, index) => (_jsx("tr", { className: props.rowClassName?.(row, index), children: props.columns.map((column) => (_jsx("td", { className: resolveCellClassName(column, row, index), children: column.cell(row, index) }, column.key))) }, props.rowKey(row, index)))) }), props.footer === undefined ? null : _jsx("tfoot", { children: props.footer })] }) }));
|
|
19
75
|
}
|
|
20
76
|
//# sourceMappingURL=DataTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../src/react/components/DataTable.tsx"],"names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,IAbJ,MAAM,CAAC,GAAG,CAcZ,CACN,CAAC;wBACJ,CAAC,CAAC,GACC,GACC,EACR,0BACG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,aAAmC,SAAS,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,YAC3E,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,aAAqB,SAAS,EAAE,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,YACrE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IADjB,MAAM,CAAC,GAAG,CAEd,CACN,CAAC,IALK,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAM5B,CACN,CAAC,GACI,EACP,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAAQ,KAAK,CAAC,MAAM,GAAS,IAC5D,GACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { type CanvasEmbedPlaceholderDescriptor, type InteractiveHtmlEditorProps
|
|
|
5
5
|
* which is not always called with a real DOM `Element` — see that helper's own doc. */
|
|
6
6
|
export declare function isProtectedEmbedElement(el: Element): boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Recognizes a `data-embed-config` marker (`
|
|
8
|
+
* Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
|
|
9
9
|
* convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
|
|
10
10
|
* `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
|
|
11
11
|
* result. Exported for direct unit-testability without mounting the editor, same convention
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveHtmlEditor.d.ts","sourceRoot":"","sources":["../../../../src/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,IAAI,eAAe,EACnD,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"InteractiveHtmlEditor.d.ts","sourceRoot":"","sources":["../../../../src/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,IAAI,eAAe,EACnD,MAAM,yBAAyB,CAAC;AAmCjC;;;wFAGwF;AACxF,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAE5D;AA2ED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,OAAO,GAAG,gCAAgC,GAAG,SAAS,CAelG;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,eAAe,EAAE,oBAAoB,GAAG,0BAA0B,CAAC,CAAC;AAElH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BAQtE"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from '@jini-ai/ui/html-editor';
|
|
3
3
|
/**
|
|
4
|
-
* @file
|
|
5
|
-
* Page's `body_html` (the first caller — see
|
|
4
|
+
* @file Consuming-product-specific composition of `@jini-ai/ui/html-editor`'s generic
|
|
5
|
+
* `InteractiveHtmlEditor`: a Page's `body_html` (the first caller — see the consuming product's own
|
|
6
|
+
* `apps/admin/src/features/pages/PageEditor.tsx`)
|
|
6
7
|
* can carry `<div data-embed-type="…" data-embed-id="…"></div>` placeholders (and the legacy
|
|
7
8
|
* `data-widget-embed`/`data-form-embed` attributes on migration-era rows) that a separate scanner
|
|
8
|
-
* (`
|
|
9
|
+
* (that product's own `src/widgets/html-embeds.ts`) resolves at render time — that scanner requires the div to
|
|
9
10
|
* stay exactly empty and self-closing, and degrades silently, with no error, the moment anything is
|
|
10
11
|
* written inside one. The CURRENT convention has since moved to a single `data-embed-config`
|
|
11
|
-
* attribute carrying a JSON payload (`
|
|
12
|
+
* attribute carrying a JSON payload (that product's own `src/core/embeds/marker.ts`); `isProtectedEmbedElement`
|
|
12
13
|
* below has not been updated to recognize it (tracked separately — see that function's own doc), but
|
|
13
14
|
* `describeEmbedPlaceholder` below IS built against the current convention, since it only needs to
|
|
14
15
|
* read the marker, not police edits to it.
|
|
@@ -19,11 +20,11 @@ import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from
|
|
|
19
20
|
* unchanged.
|
|
20
21
|
*/
|
|
21
22
|
/** The attribute either the current (`data-embed-type`) or legacy (`data-widget-embed`,
|
|
22
|
-
* `data-form-embed`) convention uses to mark a Page HTML embed placeholder div — see
|
|
23
|
-
* `
|
|
23
|
+
* `data-form-embed`) convention uses to mark a Page HTML embed placeholder div — see the
|
|
24
|
+
* consuming product's own `src/widgets/html-embeds.ts`'s file header for the convention this protects.
|
|
24
25
|
*
|
|
25
|
-
* **Does NOT include `data-embed-config`, the CURRENT marker attribute** (
|
|
26
|
-
* marker.ts`) — a known, separately-tracked gap: an embed marker written the current way is still
|
|
26
|
+
* **Does NOT include `data-embed-config`, the CURRENT marker attribute** (the consuming product's own
|
|
27
|
+
* `src/core/embeds/marker.ts`) — a known, separately-tracked gap: an embed marker written the current way is still
|
|
27
28
|
* editable/draggable/removable in this editor today. Left alone here deliberately (out of scope for
|
|
28
29
|
* the placeholder-card feature this file's `describeEmbedPlaceholder` was added for); widening this
|
|
29
30
|
* list to close that gap is a one-line fix (`'data-embed-config'` added below) but changes real
|
|
@@ -39,14 +40,14 @@ export function isProtectedEmbedElement(el) {
|
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Friendly card headings for every embed `type` value this codebase names anywhere, split into two
|
|
42
|
-
* groups (traced against `
|
|
43
|
+
* groups (traced against the consuming product's own `src/server/http/site/render.ts`'s `renderHtmlPageBody`/`isPageEmbedType`
|
|
43
44
|
* at the owner's own request, 2026-08-25 — authoritative, not re-derived):
|
|
44
45
|
*
|
|
45
46
|
* - **`media`, `widget`, `post`, `content`** — the ONLY four types `isPageEmbedType` (gating
|
|
46
47
|
* `renderHtmlPageBody`, `render.ts:1238`) accepts, i.e. the complete set a Page's `body_html` — what
|
|
47
48
|
* this editor edits — can ever actually contain. These are the types an operator can realistically
|
|
48
49
|
* hit in the Interactive tab.
|
|
49
|
-
* - **`partial`, `menu`** — `
|
|
50
|
+
* - **`partial`, `menu`** — the consuming product's own `src/widgets/resolver-service.ts`'s `THEME_OWNED_MARKER_TYPES`. NOT
|
|
50
51
|
* reachable inside a Page body — they live in THEME TEMPLATES (site header/nav/footer), authored
|
|
51
52
|
* outside this editor entirely, so this component should not grow UI affordances assuming one can
|
|
52
53
|
* appear here. Labeled anyway (rather than left to the generic fallback below) purely so the ONE
|
|
@@ -64,7 +65,7 @@ export function isProtectedEmbedElement(el) {
|
|
|
64
65
|
* Matched lower-cased — see `identityLabel`'s doc and `core/embeds/marker.ts`'s own `toEmbedRef` for
|
|
65
66
|
* why the server-side scanner lower-cases `type` the same way. An unregistered type is not an error
|
|
66
67
|
* here (unlike a rejected/unparseable marker) — `type` is deliberately a free string end-to-end (see
|
|
67
|
-
* `
|
|
68
|
+
* the consuming product's own `src/widgets/html-embeds.ts`'s file header) precisely so a new one (a marketplace theme
|
|
68
69
|
* introducing its own, say) never requires a matching change on this list AND never renders nothing —
|
|
69
70
|
* `titleCase` below covers it with a still-legible generic card instead of a blank/thrown result.
|
|
70
71
|
*/
|
|
@@ -109,7 +110,7 @@ function identityLabel(config) {
|
|
|
109
110
|
return id.length > ID_PREVIEW_LENGTH ? `id ${id.slice(0, ID_PREVIEW_LENGTH)}…` : `id ${id}`;
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
|
-
* Recognizes a `data-embed-config` marker (`
|
|
113
|
+
* Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
|
|
113
114
|
* convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
|
|
114
115
|
* `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
|
|
115
116
|
* result. Exported for direct unit-testability without mounting the editor, same convention
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveHtmlEditor.js","sourceRoot":"","sources":["../../../../src/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,qBAAqB,IAAI,UAAU,EACnC,0BAA0B,GAG3B,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"InteractiveHtmlEditor.js","sourceRoot":"","sources":["../../../../src/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,qBAAqB,IAAI,UAAU,EACnC,0BAA0B,GAG3B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;oGAUoG;AACpG,MAAM,uBAAuB,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,CAAU,CAAC;AAErG;;;wFAGwF;AACxF,MAAM,UAAU,uBAAuB,CAAC,EAAW;IACjD,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;AACtF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,iBAAiB,GAAqC;IAC1D,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF;u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CAAC;IACnB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7F,MAAM,MAAM,GAAG,MAAiC,CAAC;IACjD,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAE5E,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACvC,OAAO,EAAE,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;AACzG,CAAC;AAID,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,OAAO,CACL,KAAC,UAAU,OACL,KAAK,EACT,kBAAkB,EAAE,uBAAuB,EAC3C,wBAAwB,EAAE,wBAAwB,GAClD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/react/components/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/react/components/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAsEhF;4DAC4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,CAAC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wBAAwB,+BAwB3D;AAED,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,sDAAsD;IACtD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;wCAEoC;IACpC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAC;IAC3G;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,+BA4GzC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8FAA8F;AAC9F,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAE/C;AAED,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAsBvD;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;CAKlB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment, createContext, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
2
|
+
import { Fragment, createContext, createElement, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { DEFAULT_ADMIN_BASE, adminHref } from '../../core/routing/rules.js';
|
|
5
5
|
import { useNavSections } from '../hooks/use-nav-sections.js';
|
|
@@ -18,8 +18,96 @@ export function useSidebar() {
|
|
|
18
18
|
}
|
|
19
19
|
return value;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Shape elements `AdminNavEntry.icon` markup may use. A host draws its own glyphs as raw inner
|
|
23
|
+
* SVG (see that field's doc comment in `core/manifest/types.ts`), so this can't be a fixed set of
|
|
24
|
+
* named icons — but it also means the string reaching {@link Icon} was written by whoever owns the
|
|
25
|
+
* nav entry, which soon enough will be a descriptor rather than code. `g` is included so multi-path
|
|
26
|
+
* icons can group and transform their pieces together.
|
|
27
|
+
*/
|
|
28
|
+
const ICON_ALLOWED_TAGS = new Set(['path', 'circle', 'rect', 'line', 'polygon', 'polyline', 'ellipse', 'g']);
|
|
29
|
+
/**
|
|
30
|
+
* Presentation attributes let through on an icon shape, mapped from their SVG/XML spelling to the
|
|
31
|
+
* camelCase prop name React expects. Anything not listed here — `style`, `href`/`xlink:href`, every
|
|
32
|
+
* `on*` handler — is dropped by {@link sanitizeIconNode} rather than passed through, so there is no
|
|
33
|
+
* allowlist gap to keep in sync with a separate denylist.
|
|
34
|
+
*/
|
|
35
|
+
const ICON_ALLOWED_ATTRS = {
|
|
36
|
+
d: 'd',
|
|
37
|
+
cx: 'cx',
|
|
38
|
+
cy: 'cy',
|
|
39
|
+
r: 'r',
|
|
40
|
+
rx: 'rx',
|
|
41
|
+
ry: 'ry',
|
|
42
|
+
x: 'x',
|
|
43
|
+
y: 'y',
|
|
44
|
+
width: 'width',
|
|
45
|
+
height: 'height',
|
|
46
|
+
x1: 'x1',
|
|
47
|
+
y1: 'y1',
|
|
48
|
+
x2: 'x2',
|
|
49
|
+
y2: 'y2',
|
|
50
|
+
points: 'points',
|
|
51
|
+
transform: 'transform',
|
|
52
|
+
fill: 'fill',
|
|
53
|
+
'fill-rule': 'fillRule',
|
|
54
|
+
opacity: 'opacity',
|
|
55
|
+
'stroke-width': 'strokeWidth',
|
|
56
|
+
'stroke-linecap': 'strokeLinecap',
|
|
57
|
+
'stroke-linejoin': 'strokeLinejoin',
|
|
58
|
+
'clip-rule': 'clipRule',
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Rebuilds one parsed element as a React element, keeping only {@link ICON_ALLOWED_TAGS} /
|
|
62
|
+
* {@link ICON_ALLOWED_ATTRS}. This is what stands in for `dangerouslySetInnerHTML`: the browser's
|
|
63
|
+
* own parser does the tokenizing (far less error-prone than a hand-rolled regex over SVG/XML), and
|
|
64
|
+
* this function decides what survives the trip into React's tree — a `<script>`, a `<foreignObject>`
|
|
65
|
+
* carrying arbitrary HTML, an `<image>`/`<use>` reference, or an `onload=` attribute all fail to
|
|
66
|
+
* match anything on either allowlist and are simply not there afterward, whatever they contained.
|
|
67
|
+
*/
|
|
68
|
+
function sanitizeIconNode(node, key) {
|
|
69
|
+
const tag = node.tagName.toLowerCase();
|
|
70
|
+
if (!ICON_ALLOWED_TAGS.has(tag))
|
|
71
|
+
return null;
|
|
72
|
+
// `key` goes straight into the props object — `createElement` pulls it out as the element's
|
|
73
|
+
// reserved key rather than forwarding it to the DOM, the same as writing `key={key}` in JSX.
|
|
74
|
+
const props = { key };
|
|
75
|
+
for (const attr of Array.from(node.attributes)) {
|
|
76
|
+
const propName = ICON_ALLOWED_ATTRS[attr.name.toLowerCase()];
|
|
77
|
+
if (propName)
|
|
78
|
+
props[propName] = attr.value;
|
|
79
|
+
}
|
|
80
|
+
const children = Array.from(node.children)
|
|
81
|
+
.map((child, i) => sanitizeIconNode(child, i))
|
|
82
|
+
.filter((child) => child !== null);
|
|
83
|
+
return createElement(tag, props, children.length ? children : undefined);
|
|
84
|
+
}
|
|
85
|
+
// Reused across parses rather than constructed per render — `DOMParser` instances are stateless
|
|
86
|
+
// and this runs once per icon render, but there is no reason to pay allocation cost for it twice.
|
|
87
|
+
let iconMarkupParser;
|
|
88
|
+
/**
|
|
89
|
+
* Parses one `AdminNavEntry.icon` string into a sanitized element list. Wrapping in a throwaway
|
|
90
|
+
* `<svg>` document (never attached to the page — this is markup parsing, not rendering) lets the
|
|
91
|
+
* browser's own XML parser validate structure for free: malformed markup surfaces as a
|
|
92
|
+
* `parsererror` node, which is treated the same as empty input — the row loses its icon, not its
|
|
93
|
+
* label or link.
|
|
94
|
+
*/
|
|
95
|
+
function parseIconMarkup(markup) {
|
|
96
|
+
if (!markup)
|
|
97
|
+
return [];
|
|
98
|
+
iconMarkupParser ??= new DOMParser();
|
|
99
|
+
const doc = iconMarkupParser.parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${markup}</svg>`, 'image/svg+xml');
|
|
100
|
+
if (doc.getElementsByTagName('parsererror').length > 0)
|
|
101
|
+
return [];
|
|
102
|
+
return Array.from(doc.documentElement.children)
|
|
103
|
+
.map((child, i) => sanitizeIconNode(child, i))
|
|
104
|
+
.filter((child) => child !== null);
|
|
105
|
+
}
|
|
21
106
|
function Icon(props) {
|
|
22
|
-
|
|
107
|
+
// Re-parsing on every keystroke of an unrelated state update would be wasted work for a string
|
|
108
|
+
// that, in practice, never changes after the nav manifest is built.
|
|
109
|
+
const children = useMemo(() => parseIconMarkup(props.markup), [props.markup]);
|
|
110
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", strokeWidth: 1.5, children: children }));
|
|
23
111
|
}
|
|
24
112
|
/**
|
|
25
113
|
* Rail-mode tooltip, portaled to `document.body`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../src/react/components/Sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,
|
|
1
|
+
{"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../src/react/components/Sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,OA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AAW,EAAE;IAChD,YAAY,EAAE,mBAAmB;IACjC,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,aAAa;IACrB,UAAU,EAAE,iBAAiB;CAC9B,CAAC,CAAC"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* appear only where a value must be measured at runtime — portal coordinates in `Sidebar`'s rail
|
|
18
18
|
* tooltip and `RowMenu`'s popup. `InteractiveHtmlEditor` is the exception: it (transitively, via
|
|
19
19
|
* `@jini-ai/ui/html-editor`, which this file's own `InteractiveHtmlEditor` composes with a
|
|
20
|
-
*
|
|
20
|
+
* consuming-product-specific embed-protection predicate) imports GrapesJS's own vendor stylesheet, because it
|
|
21
21
|
* wraps a third-party editor whose chrome does not render without it — see that primitive's file
|
|
22
22
|
* header for why this isn't authored styling the exception undoes.
|
|
23
23
|
*
|
|
@@ -39,7 +39,7 @@ export { ConfirmDialog } from './components/ConfirmDialog/ConfirmDialog.js';
|
|
|
39
39
|
export type { ConfirmDialogProps } from './components/ConfirmDialog/ConfirmDialog.js';
|
|
40
40
|
export type { ConfirmDialogController, UseConfirmDialog } from './components/ConfirmDialog/ConfirmDialog.hooks.js';
|
|
41
41
|
export { DataTable } from './components/DataTable.js';
|
|
42
|
-
export type { DataTableColumn, DataTableProps } from './components/DataTable.js';
|
|
42
|
+
export type { DataTableColumn, DataTableColumnSort, DataTableProps, DataTableSortDirection, DataTableSortState, } from './components/DataTable.js';
|
|
43
43
|
export { InteractiveHtmlEditor } from './components/InteractiveHtmlEditor/InteractiveHtmlEditor.js';
|
|
44
44
|
export type { InteractiveHtmlEditorProps } from './components/InteractiveHtmlEditor/InteractiveHtmlEditor.js';
|
|
45
45
|
export { RowMenu } from './components/RowMenu/RowMenu.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAKjF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/F,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/F,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/react/index.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* appear only where a value must be measured at runtime — portal coordinates in `Sidebar`'s rail
|
|
18
18
|
* tooltip and `RowMenu`'s popup. `InteractiveHtmlEditor` is the exception: it (transitively, via
|
|
19
19
|
* `@jini-ai/ui/html-editor`, which this file's own `InteractiveHtmlEditor` composes with a
|
|
20
|
-
*
|
|
20
|
+
* consuming-product-specific embed-protection predicate) imports GrapesJS's own vendor stylesheet, because it
|
|
21
21
|
* wraps a third-party editor whose chrome does not render without it — see that primitive's file
|
|
22
22
|
* header for why this isn't authored styling the exception undoes.
|
|
23
23
|
*
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
export { resolveTone, toneClassName } from './types.js';
|
|
37
37
|
export { ConfirmButton } from './components/ConfirmButton/ConfirmButton.js';
|
|
38
38
|
export { ConfirmDialog } from './components/ConfirmDialog/ConfirmDialog.js';
|
|
39
|
-
// The list table.
|
|
40
|
-
// for the corpus evidence behind
|
|
39
|
+
// The list table. Sorting is opt-in per column (`DataTableColumn.sort`); pagination and row
|
|
40
|
+
// selection are still deliberately absent — see its file header for the corpus evidence behind
|
|
41
|
+
// every one of these decisions.
|
|
41
42
|
export { DataTable } from './components/DataTable.js';
|
|
42
43
|
// Visual click-into-text editing surface for a bespoke HTML document, built on GrapesJS. See its
|
|
43
44
|
// own file header for the styling-contract exception it carries (vendor CSS import) and the
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,gGAAgG;AAChG,kDAAkD;AAClD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAM5E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,gGAAgG;AAChG,kDAAkD;AAClD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAM5E,4FAA4F;AAC5F,+FAA+F;AAC/F,gCAAgC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAStD,iGAAiG;AACjG,4FAA4F;AAC5F,wCAAwC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAGpG,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,qGAAqG;AACrG,iGAAiG;AACjG,uFAAuF;AACvF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAW9D,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE/F,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/admin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Composable admin surface for Jini-hosted products: framework-free contracts, panel registry, and route model in `/core`; React shell and panels in `/react`. Import only the layers you need.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"react-dom": "^19.2.0"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@jini-ai/agentic": "0.3.
|
|
84
|
-
"@jini-ai/ui": "0.3.
|
|
83
|
+
"@jini-ai/agentic": "0.3.6",
|
|
84
|
+
"@jini-ai/ui": "0.3.7"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"build": "tsc -p tsconfig.json",
|