@olddevs/ui 4.5.1 → 4.6.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/CHANGELOG.md +26 -0
- package/dist/editor/RichTextEditor.d.ts +2 -2
- package/dist/editor/RichTextEditor.d.ts.map +1 -1
- package/dist/editor/RichTextEditor.js +3 -0
- package/dist/editor/RichTextEditor.js.map +1 -1
- package/dist/editor/core/blockTypes.d.ts +2 -8
- package/dist/editor/core/blockTypes.d.ts.map +1 -1
- package/dist/editor/core/blockTypes.js +11 -54
- package/dist/editor/core/blockTypes.js.map +1 -1
- package/dist/editor/core/containers.d.ts.map +1 -1
- package/dist/editor/core/containers.js +1 -0
- package/dist/editor/core/containers.js.map +1 -1
- package/dist/editor/core/customMarkdown.js +1 -1
- package/dist/editor/core/customMarkdown.js.map +1 -1
- package/dist/editor/core/customTool.d.ts +6 -6
- package/dist/editor/core/customTool.d.ts.map +1 -1
- package/dist/editor/core/customToolEngine.d.ts +2 -2
- package/dist/editor/core/extensions.d.ts +7 -2
- package/dist/editor/core/extensions.d.ts.map +1 -1
- package/dist/editor/core/extensions.js +96 -64
- package/dist/editor/core/extensions.js.map +1 -1
- package/dist/editor/core/fieldNotice.d.ts +1 -1
- package/dist/editor/core/insertItems.d.ts +5 -28
- package/dist/editor/core/insertItems.d.ts.map +1 -1
- package/dist/editor/core/insertItems.js +3 -94
- package/dist/editor/core/insertItems.js.map +1 -1
- package/dist/editor/core/insertMenuTool.d.ts +13 -0
- package/dist/editor/core/insertMenuTool.d.ts.map +1 -0
- package/dist/editor/core/insertMenuTool.js +20 -0
- package/dist/editor/core/insertMenuTool.js.map +1 -0
- package/dist/editor/core/schema.d.ts +20 -5
- package/dist/editor/core/schema.d.ts.map +1 -1
- package/dist/editor/core/schema.js +18 -3
- package/dist/editor/core/schema.js.map +1 -1
- package/dist/editor/core/shortcuts.d.ts +56 -5
- package/dist/editor/core/shortcuts.d.ts.map +1 -1
- package/dist/editor/core/shortcuts.js +91 -156
- package/dist/editor/core/shortcuts.js.map +1 -1
- package/dist/editor/core/skeleton.d.ts +1 -1
- package/dist/editor/core/skeleton.d.ts.map +1 -1
- package/dist/editor/core/skeleton.js +1 -0
- package/dist/editor/core/skeleton.js.map +1 -1
- package/dist/editor/core/toolButtons.d.ts +3 -3
- package/dist/editor/core/toolDefinition.d.ts +3 -3
- package/dist/editor/core/toolDescriptor.d.ts +49 -30
- package/dist/editor/core/toolDescriptor.d.ts.map +1 -1
- package/dist/editor/core/toolDescriptor.js +2 -5
- package/dist/editor/core/toolDescriptor.js.map +1 -1
- package/dist/editor/core/toolLoader.d.ts +1 -1
- package/dist/editor/core/toolLoader.d.ts.map +1 -1
- package/dist/editor/core/toolOptions.d.ts +19 -2
- package/dist/editor/core/toolOptions.d.ts.map +1 -1
- package/dist/editor/core/toolOptions.js.map +1 -1
- package/dist/editor/core/tools.d.ts +10 -2
- package/dist/editor/core/tools.d.ts.map +1 -1
- package/dist/editor/core/tools.js +1 -0
- package/dist/editor/core/tools.js.map +1 -1
- package/dist/editor/features/builtins.d.ts +6 -8
- package/dist/editor/features/builtins.d.ts.map +1 -1
- package/dist/editor/features/builtins.js +48 -21
- package/dist/editor/features/builtins.js.map +1 -1
- package/dist/editor/features/code/codeBlockTool.d.ts +5 -6
- package/dist/editor/features/code/codeBlockTool.d.ts.map +1 -1
- package/dist/editor/features/code/codeBlockTool.js +10 -1
- package/dist/editor/features/code/codeBlockTool.js.map +1 -1
- package/dist/editor/features/color/colorTools.d.ts +14 -0
- package/dist/editor/features/color/colorTools.d.ts.map +1 -0
- package/dist/editor/features/color/colorTools.js +39 -0
- package/dist/editor/features/color/colorTools.js.map +1 -0
- package/dist/editor/features/details/details.d.ts +68 -0
- package/dist/editor/features/details/details.d.ts.map +1 -0
- package/dist/editor/features/details/details.js +237 -0
- package/dist/editor/features/details/details.js.map +1 -0
- package/dist/editor/features/details/detailsMarkdown.d.ts +17 -0
- package/dist/editor/features/details/detailsMarkdown.d.ts.map +1 -0
- package/dist/editor/features/details/detailsMarkdown.js +84 -0
- package/dist/editor/features/details/detailsMarkdown.js.map +1 -0
- package/dist/editor/features/details/detailsTool.d.ts +16 -0
- package/dist/editor/features/details/detailsTool.d.ts.map +1 -0
- package/dist/editor/features/details/detailsTool.js +39 -0
- package/dist/editor/features/details/detailsTool.js.map +1 -0
- package/dist/editor/features/emoji/emojiTool.d.ts +1 -1
- package/dist/editor/features/heading/headingTool.d.ts +18 -0
- package/dist/editor/features/heading/headingTool.d.ts.map +1 -0
- package/dist/editor/features/heading/headingTool.js +59 -0
- package/dist/editor/features/heading/headingTool.js.map +1 -0
- package/dist/editor/features/history/historyTool.d.ts +15 -0
- package/dist/editor/features/history/historyTool.d.ts.map +1 -0
- package/dist/editor/features/history/historyTool.js +28 -0
- package/dist/editor/features/history/historyTool.js.map +1 -0
- package/dist/editor/features/image/imageTool.d.ts +19 -0
- package/dist/editor/features/image/imageTool.d.ts.map +1 -0
- package/dist/editor/features/image/imageTool.js +28 -0
- package/dist/editor/features/image/imageTool.js.map +1 -0
- package/dist/editor/features/layout/layoutTool.d.ts +11 -0
- package/dist/editor/features/layout/layoutTool.d.ts.map +1 -0
- package/dist/editor/features/layout/layoutTool.js +20 -0
- package/dist/editor/features/layout/layoutTool.js.map +1 -0
- package/dist/editor/features/lists/listTools.d.ts +15 -0
- package/dist/editor/features/lists/listTools.d.ts.map +1 -0
- package/dist/editor/features/lists/listTools.js +78 -0
- package/dist/editor/features/lists/listTools.js.map +1 -0
- package/dist/editor/features/marks/markTools.d.ts +16 -0
- package/dist/editor/features/marks/markTools.d.ts.map +1 -0
- package/dist/editor/features/marks/markTools.js +43 -0
- package/dist/editor/features/marks/markTools.js.map +1 -0
- package/dist/editor/features/search/searchTool.d.ts +1 -1
- package/dist/editor/features/table/tableTool.d.ts +3 -3
- package/dist/editor/features/wrapper/wrapperTool.d.ts +11 -0
- package/dist/editor/features/wrapper/wrapperTool.d.ts.map +1 -0
- package/dist/editor/features/wrapper/wrapperTool.js +32 -0
- package/dist/editor/features/wrapper/wrapperTool.js.map +1 -0
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/schema-entry.d.ts +1 -1
- package/dist/editor/styles/prose.d.ts.map +1 -1
- package/dist/editor/styles/prose.js +26 -0
- package/dist/editor/styles/prose.js.map +1 -1
- package/dist/editor/ui/EditorToolbar.d.ts.map +1 -1
- package/dist/editor/ui/EditorToolbar.js +5 -38
- package/dist/editor/ui/EditorToolbar.js.map +1 -1
- package/dist/editor/ui/SelectionBubble.d.ts.map +1 -1
- package/dist/editor/ui/SelectionBubble.js +1 -1
- package/dist/editor/ui/SelectionBubble.js.map +1 -1
- package/dist/editor/ui/ToolButtonView.d.ts.map +1 -1
- package/dist/editor/ui/ToolButtonView.js +1 -1
- package/dist/editor/ui/ToolButtonView.js.map +1 -1
- package/dist/i18n/defaults.d.ts.map +1 -1
- package/dist/i18n/defaults.js +3 -0
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/messages.d.ts +16 -1
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/icons.d.ts +8 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/locales/ru.d.ts.map +1 -1
- package/dist/locales/ru.js +3 -0
- package/dist/locales/ru.js.map +1 -1
- package/docs/api/editor-extension.en.md +68 -68
- package/docs/api/editor-extension.md +55 -55
- package/docs/api/messages.en.md +4 -1
- package/docs/api/messages.md +3 -0
- package/docs/api/migration-notes.en.md +11 -11
- package/docs/api/migration-notes.md +2 -2
- package/docs/api/utilities.en.md +6 -6
- package/docs/components/actions/split-button.en.md +9 -9
- package/docs/components/content/data-display.en.md +1 -1
- package/docs/components/content/layout-primitives.en.md +3 -3
- package/docs/components/content/rich-text-toc.en.md +1 -1
- package/docs/components/content/rich-text-view.en.md +23 -17
- package/docs/components/content/rich-text-view.md +17 -11
- package/docs/components/content/virtual-grid.en.md +2 -2
- package/docs/components/date-time/date-picker.en.md +1 -1
- package/docs/components/inputs/rich-text-editor.en.md +283 -230
- package/docs/components/inputs/rich-text-editor.md +139 -86
- package/docs/components/navigation/mega-menu.en.md +10 -10
- package/docs/components/overlays/menu.en.md +2 -2
- package/docs/components/overlays/shortcuts-help.en.md +1 -1
- package/docs/components/table/data-table.en.md +3 -3
- package/docs/components/table/filter-bar.en.md +1 -1
- package/docs/components/table/toolbar.en.md +1 -1
- package/docs/conventions.en.md +2 -2
- package/docs/conventions.md +1 -1
- package/docs/getting-started.en.md +9 -9
- package/docs/getting-started.md +8 -8
- package/docs/glossary.en.md +193 -133
- package/docs/glossary.md +191 -132
- package/docs/icons.en.md +12 -9
- package/docs/icons.md +3 -0
- package/docs/palette.en.md +3 -3
- package/docs/theming.en.md +6 -6
- package/package.json +2 -1
- package/src/editor/RichTextEditor.tsx +9 -6
- package/src/editor/core/atomText.ts +2 -2
- package/src/editor/core/blockTypes.ts +19 -83
- package/src/editor/core/containers.ts +4 -2
- package/src/editor/core/customMarkdown.ts +2 -2
- package/src/editor/core/customTool.ts +6 -6
- package/src/editor/core/customToolEngine.ts +9 -9
- package/src/editor/core/extensions.ts +165 -110
- package/src/editor/core/fieldNotice.ts +1 -1
- package/src/editor/core/handle.ts +2 -2
- package/src/editor/core/insertItems.ts +12 -158
- package/src/editor/core/insertMenuTool.ts +32 -0
- package/src/editor/core/jsonDocument.ts +1 -1
- package/src/editor/core/schema.ts +42 -7
- package/src/editor/core/shortcuts.ts +116 -177
- package/src/editor/core/skeleton.ts +4 -3
- package/src/editor/core/toolButtons.ts +3 -3
- package/src/editor/core/toolDefinition.ts +4 -4
- package/src/editor/core/toolDescriptor.ts +65 -52
- package/src/editor/core/toolLoader.ts +3 -3
- package/src/editor/core/toolOptions.ts +21 -2
- package/src/editor/core/tools.ts +10 -1
- package/src/editor/core/viewIsland.ts +1 -1
- package/src/editor/features/builtins.ts +76 -41
- package/src/editor/features/code/codeBlockTool.ts +16 -8
- package/src/editor/features/color/colorTools.ts +68 -0
- package/src/editor/features/details/details.ts +389 -0
- package/src/editor/features/details/detailsMarkdown.ts +158 -0
- package/src/editor/features/details/detailsTool.ts +69 -0
- package/src/editor/features/emoji/emojiTool.tsx +1 -1
- package/src/editor/features/heading/headingTool.ts +96 -0
- package/src/editor/features/history/historyTool.ts +42 -0
- package/src/editor/features/image/imageTool.ts +49 -0
- package/src/editor/features/layout/layoutTool.ts +40 -0
- package/src/editor/features/lists/listTools.ts +112 -0
- package/src/editor/features/marks/markTools.ts +78 -0
- package/src/editor/features/search/searchTool.ts +1 -1
- package/src/editor/features/table/tableTool.ts +3 -3
- package/src/editor/features/toc/tocTool.ts +1 -1
- package/src/editor/features/wrapper/wrapperTool.ts +52 -0
- package/src/editor/index.ts +1 -0
- package/src/editor/schema-entry.ts +1 -1
- package/src/editor/styles/prose.ts +49 -0
- package/src/editor/ui/EditorToolbar.tsx +7 -50
- package/src/editor/ui/SelectionBubble.tsx +2 -5
- package/src/editor/ui/ToolButtonView.tsx +2 -1
- package/src/i18n/defaults.ts +3 -0
- package/src/i18n/messages.ts +14 -1
- package/src/icons.ts +7 -0
- package/src/locales/ru.ts +3 -0
|
@@ -95,7 +95,7 @@ marked `@deprecated`: the kit calls the current navigation item `active`.
|
|
|
95
95
|
|
|
96
96
|
Hovering a category with the mouse opens its flyout at once, with no delay. Exactly one category is highlighted,
|
|
97
97
|
the one whose flyout is open: the highlight follows `aria-expanded`, not `:hover`. Hovering a category without a
|
|
98
|
-
flyout closes the open one, with the same caveat about aim as below.
|
|
98
|
+
flyout closes the open one, with the same caveat about menu aim as below.
|
|
99
99
|
|
|
100
100
|
The flyout closes 150 ms after the pointer has left both the category column and the flyout, so a brief
|
|
101
101
|
excursion past the edge does not reset the catalog. It also closes on a pointer press outside the catalog and when
|
|
@@ -115,12 +115,12 @@ points to where the flyout will appear.
|
|
|
115
115
|
|
|
116
116
|
## Touch and narrow screens
|
|
117
117
|
|
|
118
|
-
Touch has no hover, so the touch itself (`click`) opens a category, without aim. A pointer whose `pointerType` is
|
|
118
|
+
Touch has no hover, so the touch itself (`click`) opens a category, without menu aim. A pointer whose `pointerType` is
|
|
119
119
|
"touch" or "pen" neither opens a category on hover nor closes the flyout when it leaves: a pen behaves like a
|
|
120
120
|
finger. Touching an open category again neither closes it nor goes anywhere. The flyout closes on a touch outside
|
|
121
121
|
the catalog or on Escape.
|
|
122
122
|
|
|
123
|
-
The mouse behaves as before: hover, aim and closing after 150 ms all remain while the screen is wide.
|
|
123
|
+
The mouse behaves as before: hover, menu aim and closing after 150 ms all remain while the screen is wide.
|
|
124
124
|
|
|
125
125
|
On a narrow screen, under 640px (the same breakpoint as `Menu` submenus and Editor submenus), there is no room beside
|
|
126
126
|
the category column for the flyout: the edge of the window would cut it off on the right. So the catalog works as a
|
|
@@ -135,7 +135,7 @@ drill-down:
|
|
|
135
135
|
- When you drill down, focus moves to "Back": the category button is hidden along with the category column, and focus
|
|
136
136
|
left on it would be lost. In the flyout on a narrow screen, the arrow key toward the category column does
|
|
137
137
|
nothing, because the column is not beside it.
|
|
138
|
-
- There is no aim on a narrow screen: hovering with the mouse does not open a category, and moving the mouse away does
|
|
138
|
+
- There is no menu aim on a narrow screen: hovering with the mouse does not open a category, and moving the mouse away does
|
|
139
139
|
not cancel the drill-down. Replacing the column under the cursor would pull it out from under the person's hand.
|
|
140
140
|
- The markup stays on the disclosure pattern: the category button keeps `aria-expanded` and `aria-controls` pointing
|
|
141
141
|
to the region on screen (the button itself is hidden during the drill-down), and the region is named after the
|
|
@@ -150,11 +150,11 @@ screen (ADR-0018): the server does not know the width, and the markup it produce
|
|
|
150
150
|
after hydration, a flyout opened by `defaultValue` is re-rendered once as a drill-down. On a phone the `nav` takes
|
|
151
151
|
the full width through the `max-sm:w-full` class; a `w-*` class from `className` applies on a wide screen.
|
|
152
152
|
|
|
153
|
-
##
|
|
153
|
+
## Menu aim
|
|
154
154
|
|
|
155
155
|
On its way from a category to its flyout, the pointer cuts diagonally and brushes against the neighboring
|
|
156
156
|
categories. If hover opened them at once, the flyout would change under the person's hand, and the links would be
|
|
157
|
-
out of reach.
|
|
157
|
+
out of reach. Menu aim watches where the pointer is heading: while it moves toward the open flyout, a neighboring
|
|
158
158
|
category does not take over the hover.
|
|
159
159
|
|
|
160
160
|
- The direction of the pointer's last step is compared with the wedge from its previous position to the two corners
|
|
@@ -163,8 +163,8 @@ category does not take over the hover.
|
|
|
163
163
|
- One movement off course is forgiven; two in a row are not, and then the category under the pointer opens.
|
|
164
164
|
- If the pointer stops for 300 ms, the category under it opens even if it was aiming. The menu does not get stuck.
|
|
165
165
|
- When the pointer reaches the flyout, the deferred switch is canceled.
|
|
166
|
-
- Clicking a category opens it at once, bypassing aim. The keyboard knows nothing about aim.
|
|
167
|
-
- Mouse only, and only on a wide screen: touch and pen open a category at once, and a narrow screen has no aim at all.
|
|
166
|
+
- Clicking a category opens it at once, bypassing menu aim. The keyboard knows nothing about menu aim.
|
|
167
|
+
- Mouse only, and only on a wide screen: touch and pen open a category at once, and a narrow screen has no menu aim at all.
|
|
168
168
|
- The first hover, while there is no flyout yet, opens the category with no delay at all: there is nothing to aim at.
|
|
169
169
|
|
|
170
170
|
The model is the same as for react-aria submenus (`Menu` with `SubmenuTrigger`), so that the two menus of the kit
|
|
@@ -303,12 +303,12 @@ into one. `MegaMenuButton` accepts the kit's button look (`variant`, `tone`, `si
|
|
|
303
303
|
|
|
304
304
|
## Related sources and tests
|
|
305
305
|
|
|
306
|
-
- Implementation: `src/components/navigation/MegaMenu.tsx`; aim is in `src/components/navigation/useMenuAim.ts`.
|
|
306
|
+
- Implementation: `src/components/navigation/MegaMenu.tsx`; menu aim is in `src/components/navigation/useMenuAim.ts`.
|
|
307
307
|
- Tests: `tests/mega-menu.test.tsx` covers roles and `aria-controls`, hover and mounting only the open
|
|
308
308
|
flyout, closing with a delay, roving tabindex, Enter, Escape and the arrows, Tab past the last link,
|
|
309
309
|
a category that is a link, a disabled category, `active` and the `current` alias, `asChild` and `link` (on a
|
|
310
310
|
category and on a column), fragments in a column, the current section and the Tab stop, typeahead, categories
|
|
311
|
-
inside your own components, the controlled value, a press outside the catalog and server rendering; `tests/mega-menu-aim.test.tsx` covers aim on mocked geometry and fake
|
|
311
|
+
inside your own components, the controlled value, a press outside the catalog and server rendering; `tests/mega-menu-aim.test.tsx` covers menu aim on mocked geometry and fake
|
|
312
312
|
time, and the flip at the edge; `tests/mega-menu-touch.test.tsx` covers touch and pen, a mocked `matchMedia`,
|
|
313
313
|
the drill-down in place of the category column, "Back" and focus, Escape, labels from the message catalog, the
|
|
314
314
|
drill-down with categories inside your own components and server rendering; the browser test
|
|
@@ -17,7 +17,7 @@ use the dedicated `MenuButton`, not a regular `Button`: only it reads react-aria
|
|
|
17
17
|
`ButtonContext`. The menu suits heterogeneous commands, sections, selected modes
|
|
18
18
|
and submenus; it is not for choosing a field value. A nested `Menu` inside
|
|
19
19
|
`SubmenuTrigger` opens beside its item on its own, and below it on a narrow
|
|
20
|
-
screen: you do not need to set `placement`. The "aim" (protection that keeps a
|
|
20
|
+
screen: you do not need to set `placement`. The "menu aim" (protection that keeps a
|
|
21
21
|
submenu from closing while the pointer travels toward it) comes from react-aria;
|
|
22
22
|
do not write your own.
|
|
23
23
|
|
|
@@ -80,7 +80,7 @@ writing, use `end top` or `start top`. The root menu opens as before, at `bottom
|
|
|
80
80
|
submenus follow the same rule.
|
|
81
81
|
|
|
82
82
|
Moving the pointer diagonally toward a submenu neither closes it nor switches to a
|
|
83
|
-
neighboring item: this "aim" is handled by react-aria's `SubmenuTrigger`. The kit
|
|
83
|
+
neighboring item: this "menu aim" is handled by react-aria's `SubmenuTrigger`. The kit
|
|
84
84
|
does not replace it and adds none of its own, so do not write one on top of it.
|
|
85
85
|
|
|
86
86
|
react-aria sets the menu panel's height from the visible area. Items that do
|
|
@@ -159,7 +159,7 @@ not know the shortcuts and their names.
|
|
|
159
159
|
single key gets no separator.
|
|
160
160
|
- In `CommandPalette` an item's shortcut is entirely `aria-hidden` — it is a reminder
|
|
161
161
|
next to an item that can be chosen anyway. Here the shortcut is the dialog's
|
|
162
|
-
only content, and hiding it would hand a screen reader an empty
|
|
162
|
+
only content, and hiding it would hand a screen reader an empty keyboard shortcuts dialog.
|
|
163
163
|
- **Scrolling inside the dialog.** The list sits in a `ScrollArea` no taller than
|
|
164
164
|
70% of the screen height and no taller than 32rem: the header with the close
|
|
165
165
|
button stays in place. The area is a Tab stop with a separate name ("Shortcuts" /
|
|
@@ -13,14 +13,14 @@ sourceHash: a5e9fc1a0c10
|
|
|
13
13
|
## Summary for AI
|
|
14
14
|
|
|
15
15
|
An application-level table with ready-made behavior on top of the low-level `Table`:
|
|
16
|
-
column visibility and order, density, loading and error states, a table
|
|
16
|
+
column visibility and order, density, loading and error states, a table toolbar slot
|
|
17
17
|
(`toolbar`). It keeps no state of its own: it accepts `state` and reports changes as a
|
|
18
18
|
patch, usually to `useTableState`.
|
|
19
19
|
|
|
20
20
|
## When to use
|
|
21
21
|
|
|
22
22
|
- A list of entities in an admin panel: filters, column preferences, bulk actions.
|
|
23
|
-
- Anywhere a table needs a table
|
|
23
|
+
- Anywhere a table needs a table toolbar and user preferences.
|
|
24
24
|
|
|
25
25
|
## When not to use
|
|
26
26
|
|
|
@@ -57,7 +57,7 @@ const { state, set } = useTableState();
|
|
|
57
57
|
| `selectable` | `false` | The checkbox column. A separate prop — see below. |
|
|
58
58
|
| `loading` | `false` | Loading is in progress. The behavior depends on whether data exists. |
|
|
59
59
|
| `error` | — | **Always** replaces the body, even when there is data. |
|
|
60
|
-
| `toolbar` | — | The table
|
|
60
|
+
| `toolbar` | — | The table toolbar — usually `TableToolbar`. |
|
|
61
61
|
|
|
62
62
|
The other props go to `Table` — including `renderDetail`, `rowLabel` and
|
|
63
63
|
`onRowAction`.
|
|
@@ -106,7 +106,7 @@ The filter that gets built is an ordinary `TableFilter` with an optional `to`:
|
|
|
106
106
|
- **A field with an already applied range is not offered again.** Two ranges on
|
|
107
107
|
one field are an intersection, not an addition, and the tokens could not be
|
|
108
108
|
told apart. The token identifier is `<field>:range`.
|
|
109
|
-
- **The consumer computes the
|
|
109
|
+
- **The consumer computes the filtered rows.** The kit describes the shape of the
|
|
110
110
|
filter, it does not filter data
|
|
111
111
|
(ADR-0023):
|
|
112
112
|
how to treat the bounds (inclusive, in which time zone) is the application's
|
|
@@ -12,7 +12,7 @@ sourceHash: 957697357a68
|
|
|
12
12
|
|
|
13
13
|
## Summary for AI
|
|
14
14
|
|
|
15
|
-
`TableToolbar` is the table
|
|
15
|
+
`TableToolbar` is the table toolbar: a title, a counter, actions, a filters slot and a
|
|
16
16
|
preferences slot. `TablePreferences` is the content behind the gear button: column
|
|
17
17
|
visibility and order, density. Neither stores state: everything comes from above,
|
|
18
18
|
usually from `useTableState`.
|
package/docs/conventions.en.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
sourceHash:
|
|
2
|
+
sourceHash: 502667bd31f1
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# General conventions for `@olddevs/ui`
|
|
@@ -285,7 +285,7 @@ already catches itself. A violation after which the component cannot work is not
|
|
|
285
285
|
(`vi.stubEnv`), and it stays silent on a correct call.
|
|
286
286
|
|
|
287
287
|
**An error instead of a warning: `devError(message, cause?)`.** Use it when a violation breaks the whole component
|
|
288
|
-
but not the page: the Tool set of `RichTextEditor` is built incorrectly, the loader of
|
|
288
|
+
but not the page: the Tool set of `RichTextEditor` is built incorrectly, the loader of the Extensions failed,
|
|
289
289
|
`rangeAt` of the Text card threw an exception. The field shows the author a catalog string on its own, and the
|
|
290
290
|
cause goes to the developer through `console.error`, with the same rules as `devWarn`: in development, once per
|
|
291
291
|
text, in English.
|
package/docs/conventions.md
CHANGED
|
@@ -320,7 +320,7 @@ ADR-0034.
|
|
|
320
320
|
|
|
321
321
|
**Ошибка вместо предупреждения — `devError(message, cause?)`.** Когда нарушение
|
|
322
322
|
ломает компонент целиком, но не страницу: набор Инструментов `RichTextEditor`
|
|
323
|
-
собран с ошибкой, Загрузчик
|
|
323
|
+
собран с ошибкой, Загрузчик Extensions упал, `rangeAt` Карточки бросил
|
|
324
324
|
исключение. Поле само показывает автору строку каталога (`editor.toolsFailed`),
|
|
325
325
|
а причина уходит разработчику через `console.error` — с теми же правилами, что у
|
|
326
326
|
`devWarn`: в разработке, один раз на текст, по-английски.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
sourceHash:
|
|
2
|
+
sourceHash: 45289d832ab0
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Setting up `@olddevs/ui`
|
|
@@ -132,12 +132,12 @@ peer dependencies are treated as external, and the metric is gzip:
|
|
|
132
132
|
| `cn` and `tableStateToParams` | 0.6 kB |
|
|
133
133
|
| one `Button` | 1.6 kB |
|
|
134
134
|
| `DataTable` | 9.0 kB |
|
|
135
|
-
| the whole kit (`import *`) | 77.
|
|
136
|
-
| `RichTextEditor` from `@olddevs/ui/editor`, without the engine, "start" |
|
|
137
|
-
| `RichTextEditor` with the Tiptap engine, "start" (static graph, `basic`) |
|
|
138
|
-
| `RichTextEditor` with the Tiptap engine, "full" (with all lazy chunks, `full`) |
|
|
139
|
-
| `RichTextView` from `@olddevs/ui/editor`, Tiptap engine included in the measurement | 12.
|
|
140
|
-
| `sanitizeRichText` and `richTextSanitizeConfig` from `@olddevs/ui/editor/schema`, Tiptap engine included |
|
|
135
|
+
| the whole kit (`import *`) | 77.2 kB |
|
|
136
|
+
| `RichTextEditor` from `@olddevs/ui/editor`, without the engine, "start" | 75.9 kB |
|
|
137
|
+
| `RichTextEditor` with the Tiptap engine, "start" (static graph, `basic`) | 305.3 kB |
|
|
138
|
+
| `RichTextEditor` with the Tiptap engine, "full" (with all lazy chunks, `full`) | 354.6 kB |
|
|
139
|
+
| `RichTextView` from `@olddevs/ui/editor`, Tiptap engine included in the measurement | 12.7 kB |
|
|
140
|
+
| `sanitizeRichText` and `richTextSanitizeConfig` from `@olddevs/ui/editor/schema`, Tiptap engine included | 4.0 kB |
|
|
141
141
|
| `highlightCodeBlocks` from `@olddevs/ui/editor/highlight`, with lowlight | 22.6 kB |
|
|
142
142
|
| `highlightCodeNodes` from `@olddevs/ui/editor/highlight`, with lowlight | 22.6 kB |
|
|
143
143
|
|
|
@@ -146,7 +146,7 @@ The last seven rows are separate Editor entry points with their own budgets
|
|
|
146
146
|
them are scenarios (ADR-0058, item 11.7):
|
|
147
147
|
**"start"** is the static graph, what ships immediately and what the `basic` Preset costs; **"full"** is the same
|
|
148
148
|
plus all the lazy chunks of the entry point, what `full` ends up loading. The code Block and the table (absent from `basic`,
|
|
149
|
-
and their
|
|
149
|
+
and their Extensions weigh more than 10 kB) load lazily; until they arrive, an Editor that includes them shows a Skeleton.
|
|
150
150
|
`npm run size` checks that their modules are not in "start". The kit's own code is measured at "start".
|
|
151
151
|
|
|
152
152
|
In the scenarios the engine is **included in the measurement** on purpose: the consumer installs Tiptap, but
|
|
@@ -158,7 +158,7 @@ an app bundler with full minification produced about 133 kB (measured before the
|
|
|
158
158
|
For `RichTextView`, Tiptap and lowlight are included in the measurement as a check. Its row contains only
|
|
159
159
|
typography and the Island of the "Copy" button on code Blocks (the kit's button and tooltip, the message catalog),
|
|
160
160
|
and the measurement proves that its graph contains neither the engine nor a highlighter. The lightweight
|
|
161
|
-
`@olddevs/ui/editor/schema` entry point is measured the same way (
|
|
161
|
+
`@olddevs/ui/editor/schema` entry point is measured the same way (4.0 kB): the Schema, `richTextSchema`, the
|
|
162
162
|
`sanitizeRichText` sanitizer with hooks for DOMPurify, including for the rules of custom Tools, and `markRange`.
|
|
163
163
|
|
|
164
164
|
Server-side highlighting in `@olddevs/ui/editor/highlight` (22.6 kB — almost entirely the highlight.js core and
|
package/docs/getting-started.md
CHANGED
|
@@ -129,12 +129,12 @@ peer-зависимости внешние, метрика gzip:
|
|
|
129
129
|
| `cn` и `tableStateToParams` | 0,6 кБ |
|
|
130
130
|
| одна `Button` | 1,6 кБ |
|
|
131
131
|
| `DataTable` | 9,0 кБ |
|
|
132
|
-
| весь кит целиком (`import *`) | 77,
|
|
133
|
-
| `RichTextEditor` из `@olddevs/ui/editor`, без движка, «старт» |
|
|
134
|
-
| `RichTextEditor` вместе с движком Tiptap, «старт» (статический граф, `basic`) |
|
|
135
|
-
| `RichTextEditor` вместе с движком Tiptap, «полный» (со всеми ленивыми чанками, `full`) |
|
|
136
|
-
| `RichTextView` из `@olddevs/ui/editor`, движок Tiptap в замер включён | 12,
|
|
137
|
-
| `sanitizeRichText` и `richTextSanitizeConfig` из `@olddevs/ui/editor/schema`, движок Tiptap в замер включён |
|
|
132
|
+
| весь кит целиком (`import *`) | 77,2 кБ |
|
|
133
|
+
| `RichTextEditor` из `@olddevs/ui/editor`, без движка, «старт» | 75,9 кБ |
|
|
134
|
+
| `RichTextEditor` вместе с движком Tiptap, «старт» (статический граф, `basic`) | 305,3 кБ |
|
|
135
|
+
| `RichTextEditor` вместе с движком Tiptap, «полный» (со всеми ленивыми чанками, `full`) | 354,6 кБ |
|
|
136
|
+
| `RichTextView` из `@olddevs/ui/editor`, движок Tiptap в замер включён | 12,7 кБ |
|
|
137
|
+
| `sanitizeRichText` и `richTextSanitizeConfig` из `@olddevs/ui/editor/schema`, движок Tiptap в замер включён | 4,0 кБ |
|
|
138
138
|
| `highlightCodeBlocks` из `@olddevs/ui/editor/highlight`, вместе с lowlight | 22,6 кБ |
|
|
139
139
|
| `highlightCodeNodes` из `@olddevs/ui/editor/highlight`, вместе с lowlight | 22,6 кБ |
|
|
140
140
|
|
|
@@ -143,7 +143,7 @@ peer-зависимости внешние, метрика gzip:
|
|
|
143
143
|
них — сценарии (ADR-0058, п. 11.7):
|
|
144
144
|
**«старт»** — статический граф, то, что едет сразу и что платит Пресет `basic`; **«полный»** — он же
|
|
145
145
|
плюс все ленивые чанки входа, то, что в итоге грузит `full`. Блок кода и таблица (их нет в `basic`,
|
|
146
|
-
а их
|
|
146
|
+
а их Extensions тяжелее 10 кБ) грузятся лениво; до их прихода Редактор, в котором они есть,
|
|
147
147
|
показывает Скелет. `npm run size` проверяет, что их модулей в «старте» нет. Код кита меряется на «старте».
|
|
148
148
|
|
|
149
149
|
В сценариях движок **внесён в замер** намеренно: Tiptap ставит потребитель, но набор его расширений
|
|
@@ -155,7 +155,7 @@ peer-зависимости внешние, метрика gzip:
|
|
|
155
155
|
У `RichTextView` Tiptap и lowlight внесены в замер ради проверки. В его строку входят только
|
|
156
156
|
типографика и Остров кнопки «Копировать» у Блоков кода (кнопка и подсказка кита, каталог сообщений),
|
|
157
157
|
и замер доказывает, что в графе нет ни движка, ни подсветчика. Так же меряется лёгкий вход
|
|
158
|
-
`@olddevs/ui/editor/schema` (
|
|
158
|
+
`@olddevs/ui/editor/schema` (4,0 кБ): Схема, `richTextSchema`, очистка `sanitizeRichText` с хуками для
|
|
159
159
|
DOMPurify, в том числе по правилам своих Инструментов, и `markRange`.
|
|
160
160
|
|
|
161
161
|
Серверная подсветка `@olddevs/ui/editor/highlight` (22,6 кБ — почти целиком ядро highlight.js и
|