oasis-editor 0.0.284 → 0.0.286
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/{OasisEditorApp-bxIUg1ry.js → OasisEditorApp--pDBHFEl.js} +1 -1
- package/dist/defaultToolbar-DbTbnEI1.js +1 -0
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ui/components/Toolbar/controls/ImageSizeControls.d.ts +3 -1
- package/dist/ui/components/Toolbar/groups/MetricGroup.d.ts +8 -1
- package/dist/ui/components/Toolbar/primitives/MetricField.d.ts +24 -0
- package/dist/ui/components/Toolbar/ribbon/ribbonModel.d.ts +9 -0
- package/dist/utils/parseNumber.d.ts +14 -0
- package/package.json +1 -1
- package/dist/defaultToolbar-DCm3oxUm.js +0 -1
|
@@ -3,7 +3,9 @@ import { ToolbarActionApi } from '../schema/items.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* A labelled centimetre field for the image Size group (height or width). Reads
|
|
5
5
|
* the current size from the `imageHeightCm`/`imageWidthCm` command and writes it
|
|
6
|
-
* back on
|
|
6
|
+
* back on commit; the core keeps the aspect ratio locked. The draft/commit
|
|
7
|
+
* behaviour comes from `MetricField`: committing per keystroke dropped the
|
|
8
|
+
* contextual Picture Format tab after the first digit.
|
|
7
9
|
*/
|
|
8
10
|
export declare function ImageSizeField(props: {
|
|
9
11
|
api: ToolbarActionApi;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
import { ToolbarActionApi } from '../schema/items.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Paragraph metrics panel (spacing, indents, shading, borders) — command-driven.
|
|
5
|
+
*
|
|
6
|
+
* Word greys the Layout-tab Paragraph controls out in read-only documents
|
|
7
|
+
* instead of hiding the panel, so each control follows its command's enabled
|
|
8
|
+
* state. Units live in the accessible name (`Spacing After (pt)`) as well as in
|
|
9
|
+
* the visible suffix, and decimal values use the document's separator.
|
|
10
|
+
*/
|
|
4
11
|
export declare function MetricGroup(props: {
|
|
5
12
|
api: ToolbarActionApi;
|
|
6
13
|
}): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface MetricFieldProps {
|
|
3
|
+
/** Model value formatted with a dot decimal, or `""` when mixed/absent. */
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
title: string;
|
|
7
|
+
unit: "pt" | "cm";
|
|
8
|
+
testId: string;
|
|
9
|
+
/** Extra class on the field wrapper (layout-specific positioning). */
|
|
10
|
+
class?: string;
|
|
11
|
+
min?: string;
|
|
12
|
+
step?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onChange: (value: number | null) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One numeric measurement (paragraph metric, image size). Edits stay local
|
|
18
|
+
* until Enter or blur — like Word's Layout fields — because the commands that
|
|
19
|
+
* consume them return focus to the document, which would otherwise tear focus
|
|
20
|
+
* out of the field (and, for object selections, drop the contextual tab) after
|
|
21
|
+
* the first keystroke. Values display and accept the document's decimal
|
|
22
|
+
* separator (`2,5` in pt-BR); the model still stores a dot decimal.
|
|
23
|
+
*/
|
|
24
|
+
export declare function MetricField(props: MetricFieldProps): JSX.Element;
|
|
@@ -55,6 +55,15 @@ export declare function isLargeRibbonItem(item: ToolbarItem): boolean;
|
|
|
55
55
|
export declare function ribbonGroupLabel(group: string, t: TranslateFn): string;
|
|
56
56
|
/** Filter reactive visibility before grouping, without hiding disabled actions. */
|
|
57
57
|
export declare function visibleRibbonItems(items: ToolbarItem[], api: ToolbarActionApi): ToolbarItem[];
|
|
58
|
+
/**
|
|
59
|
+
* True when two {@link visibleRibbonItems} results describe the same
|
|
60
|
+
* composition: the same actions, in the same order, with the same nested
|
|
61
|
+
* children. Group wrappers are freshly allocated on every call, so they are
|
|
62
|
+
* compared by id and child identity instead of object reference. Used by the
|
|
63
|
+
* toolbar to keep the item graph stable across unrelated state changes —
|
|
64
|
+
* otherwise the ribbon `For` remounts every group and dismisses open popups.
|
|
65
|
+
*/
|
|
66
|
+
export declare function sameRibbonComposition(a: ToolbarItem[], b: ToolbarItem[]): boolean;
|
|
58
67
|
export declare function buildRibbonGroups(items: ToolbarItem[], tab: RibbonTabId, t: TranslateFn): RibbonGroupModel[];
|
|
59
68
|
/**
|
|
60
69
|
* Resolve from a fixed reduction ladder. There is no history-dependent repair
|
|
@@ -3,3 +3,17 @@
|
|
|
3
3
|
* non-numeric input. Shared across dialogs that bind numeric text fields.
|
|
4
4
|
*/
|
|
5
5
|
export declare function parseNumber(value: string): number | null;
|
|
6
|
+
/**
|
|
7
|
+
* Formats a dot-decimal string for display with the document's decimal
|
|
8
|
+
* separator (`,` in pt-BR, `.` elsewhere). Empty input stays empty, so a blank
|
|
9
|
+
* field (mixed or absent values) never renders a stray separator. Group
|
|
10
|
+
* separators are never produced: every measurement here is a plain decimal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDecimal(value: string, separator: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Parses a localized decimal string typed into a measurement field. Accepts
|
|
15
|
+
* both the document separator and the dot, so users can paste either form, and
|
|
16
|
+
* ignores the thin/non-breaking spaces some keyboards insert. Returns `null`
|
|
17
|
+
* for empty or non-numeric input.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseDecimal(value: string): number | null;
|