@arbidocs/blocks 0.4.99 → 0.4.101
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-44TPPPRJ.cjs → chunk-FAGQTB3D.cjs} +958 -272
- package/dist/chunk-FAGQTB3D.cjs.map +1 -0
- package/dist/{chunk-C5RF47LD.js → chunk-G5JH2YMQ.js} +3 -3
- package/dist/{chunk-C5RF47LD.js.map → chunk-G5JH2YMQ.js.map} +1 -1
- package/dist/{chunk-4ZTIMQ7Z.js → chunk-MYALCKDR.js} +963 -277
- package/dist/chunk-MYALCKDR.js.map +1 -0
- package/dist/{chunk-MABEOI4S.cjs → chunk-Y5XW57U4.cjs} +5 -5
- package/dist/{chunk-MABEOI4S.cjs.map → chunk-Y5XW57U4.cjs.map} +1 -1
- package/dist/{chunk-3ICWR3BK.js → chunk-YGREW5TZ.js} +3 -3
- package/dist/{chunk-3ICWR3BK.js.map → chunk-YGREW5TZ.js.map} +1 -1
- package/dist/{chunk-QBEUCOC7.cjs → chunk-ZT2EBBSC.cjs} +5 -5
- package/dist/{chunk-QBEUCOC7.cjs.map → chunk-ZT2EBBSC.cjs.map} +1 -1
- package/dist/connect/docx.cjs +6 -6
- package/dist/connect/docx.js +4 -4
- package/dist/connect/index.cjs +3 -3
- package/dist/connect/index.js +2 -2
- package/dist/docx/NativeDocxEditor.d.ts +7 -2
- package/dist/docx/definitions/DefinedTerms.d.ts +1 -12
- package/dist/docx/definitions/commands.d.ts +3 -27
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/index.d.ts +2 -1
- package/dist/docx/index.js +3 -3
- package/dist/docx/layout/GenerateImage.d.ts +50 -0
- package/dist/docx/layout/LayoutRibbon.d.ts +32 -0
- package/dist/docx/layout/LayoutTabs.d.ts +20 -0
- package/dist/docx/layout/PictureRibbon.d.ts +23 -0
- package/dist/docx/layout/TableKeys.d.ts +25 -0
- package/dist/docx/layout/TableRibbon.d.ts +11 -0
- package/dist/docx/layout/caption.d.ts +38 -0
- package/dist/docx/layout/presets.d.ts +40 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +1 -1
- package/package.json +5 -4
- package/src/docx/README.md +24 -3
- package/src/docx/layout/layout.css +120 -0
- package/src/docx/styles.css +2 -0
- package/dist/chunk-44TPPPRJ.cjs.map +0 -1
- package/dist/chunk-4ZTIMQ7Z.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native editor's Layout tab, laid out like Word's Page Setup group: Margins, Orientation,
|
|
3
|
+
* Size, Columns, Breaks, and the Page Setup dialog for anything the galleries do not offer.
|
|
4
|
+
*
|
|
5
|
+
* Everything goes through the engine's own commands: `setPageSetup` (scoped to the caret's section,
|
|
6
|
+
* as Word's galleries are) for the galleries, the engine's break slots for Breaks, and its packaged
|
|
7
|
+
* Page Setup dialog. Columns are offered but disabled: the engine lays out a document's existing
|
|
8
|
+
* `w:cols`, but has no command that writes them (see the README).
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
/** Why Columns is disabled, in the words the tooltip shows. */
|
|
12
|
+
export declare const COLUMNS_UNSUPPORTED = "Text columns are not available in this editor yet. Documents that already use columns display and save them unchanged.";
|
|
13
|
+
interface Choice {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
detail?: string;
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
title?: string;
|
|
20
|
+
}
|
|
21
|
+
/** A ribbon gallery: one column of choices, the current one marked, closing once one is picked. */
|
|
22
|
+
export declare function RibbonGallery({ label, choices, current, onPick, close, testId, }: {
|
|
23
|
+
label: string;
|
|
24
|
+
choices: readonly Choice[];
|
|
25
|
+
current?: string | null;
|
|
26
|
+
onPick: (id: string) => void;
|
|
27
|
+
close: () => void;
|
|
28
|
+
testId?: string;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
/** Layout tab: Margins, Orientation, Size, Columns, Breaks, Page Setup. */
|
|
31
|
+
export declare function LayoutButtons(): React.JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ribbon tabs this folder adds: Layout always, and Word's contextual Table and Picture tabs
|
|
3
|
+
* while the caret is in a table or a picture is selected.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export declare const LAYOUT_TAB = "Layout";
|
|
7
|
+
export declare const TABLE_TAB = "Table";
|
|
8
|
+
export declare const PICTURE_TAB = "Picture";
|
|
9
|
+
/**
|
|
10
|
+
* The contextual tabs available now, and the tab to show: a contextual tab that no longer applies
|
|
11
|
+
* (the caret left the table, the picture was deselected) falls back to Home, as Word's does.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useContextualTabs(tab: string): {
|
|
14
|
+
tabs: string[];
|
|
15
|
+
shown: string;
|
|
16
|
+
};
|
|
17
|
+
/** The body of the Layout, Table or Picture tab; nothing for the other tabs. */
|
|
18
|
+
export declare function LayoutTabContent({ tab }: {
|
|
19
|
+
tab: string;
|
|
20
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native editor's contextual Picture tab — Word's Picture Format tab — offered while a picture
|
|
3
|
+
* is selected: Wrap Text, Size & Position, Alt Text (the engine's packaged picture chrome), rotate
|
|
4
|
+
* and flip, and Insert Caption.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { useDocxEditor } from '@docx-editor.dev/react';
|
|
8
|
+
import { useTrackedOrNoted } from '../structural/useTrackedOrNoted';
|
|
9
|
+
import { type CaptionLabel } from './caption';
|
|
10
|
+
type Editor = NonNullable<ReturnType<typeof useDocxEditor>>;
|
|
11
|
+
/**
|
|
12
|
+
* Insert a caption paragraph directly after the caret's paragraph (the picture's), numbered after
|
|
13
|
+
* the captions with the same label that come before it. Returns the inserted number, or null when
|
|
14
|
+
* the editor refused.
|
|
15
|
+
*/
|
|
16
|
+
export declare function insertCaption(editor: Editor, label: CaptionLabel, text: string, track: ReturnType<typeof useTrackedOrNoted>): number | null;
|
|
17
|
+
/** Word's Insert Caption: a label, the caption text, and Insert. */
|
|
18
|
+
export declare function CaptionButton({ defaultLabel }: {
|
|
19
|
+
defaultLabel?: CaptionLabel;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
/** Picture tab: Wrap Text, Size & Position, Alt Text, rotate and flip, Insert Caption. */
|
|
22
|
+
export declare function PictureButtons(): React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word's Tab and Shift+Tab in a table: move to the next or previous cell, and Tab in the last cell
|
|
3
|
+
* adds a row. The engine types a tab character into the cell instead, so the keys are bound here,
|
|
4
|
+
* ahead of the editor's own handling, the way `WordShortcuts` binds note and style keys.
|
|
5
|
+
*/
|
|
6
|
+
import { type RefObject } from 'react';
|
|
7
|
+
type Node = {
|
|
8
|
+
id?: string;
|
|
9
|
+
kind?: string;
|
|
10
|
+
localName?: string;
|
|
11
|
+
children?: readonly Node[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The cells of the innermost table holding `paragraphId`, in reading order (each as its first
|
|
15
|
+
* paragraph), and which of them holds it. Null outside a table.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tableCells(root: Node, paragraphId: string): {
|
|
18
|
+
cells: string[];
|
|
19
|
+
index: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/** Binds Tab and Shift+Tab in tables inside `scope`. Renders nothing; mount inside `DocxEditor.Root`. */
|
|
22
|
+
export declare function TableTabKeys({ scope }: {
|
|
23
|
+
scope: RefObject<HTMLElement | null>;
|
|
24
|
+
}): null;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native editor's contextual Table tab — Word's Table Design and Table Layout tabs in one row,
|
|
3
|
+
* offered while the caret is in a table.
|
|
4
|
+
*
|
|
5
|
+
* Rows, columns, deletion and cell alignment are the engine's table commands; borders and shading
|
|
6
|
+
* are its packaged table chrome. Merge, Split and Header Row are bound to the engine's commands
|
|
7
|
+
* too, so they show the engine's own reason while it refuses them and work as soon as it does not.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
/** Table tab: insert and delete rows and columns, merge, split, header row, borders and shading. */
|
|
11
|
+
export declare function TableButtons(): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word's Insert Caption: a paragraph in the `Caption` style reading `Figure 1: text`, whose
|
|
3
|
+
* number is a `SEQ Figure` field so Word renumbers every caption when fields update.
|
|
4
|
+
*
|
|
5
|
+
* The engine has no caption command, but its paste lands an embedded `.docx` fragment intact —
|
|
6
|
+
* the `w:fldSimple` and the paragraph style, whose definition is merged into the document when
|
|
7
|
+
* the document has none. The number written as the field's result is the next one in reading
|
|
8
|
+
* order at insertion; the engine paints a SEQ field's stored result rather than recomputing it.
|
|
9
|
+
*/
|
|
10
|
+
import { type Revision } from '@arbidocs/coedit/template';
|
|
11
|
+
export declare const CAPTION_LABELS: readonly ["Figure", "Table", "Equation"];
|
|
12
|
+
export type CaptionLabel = (typeof CAPTION_LABELS)[number];
|
|
13
|
+
type Node = {
|
|
14
|
+
id?: string;
|
|
15
|
+
localName?: string;
|
|
16
|
+
kind?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
attributes?: readonly {
|
|
19
|
+
localName: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
children?: readonly Node[];
|
|
23
|
+
};
|
|
24
|
+
/** The `SEQ` identifier of a field instruction (`SEQ Figure \* ARABIC` -> `Figure`). */
|
|
25
|
+
export declare function seqIdentifier(instruction: string): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* How many `SEQ <label>` fields the tree holds — simple fields and complex `w:instrText` ones — in
|
|
28
|
+
* reading order up to and including the paragraph `throughId` (all of them when absent).
|
|
29
|
+
*/
|
|
30
|
+
export declare function countSeqFields(root: Node, label: string, throughId?: string): number;
|
|
31
|
+
/** The caption paragraph: `Label N` with N a SEQ field, then `: text` when there is text. */
|
|
32
|
+
export declare function captionParagraphXml(label: string, number: number, text: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Clipboard HTML that pastes the caption as a whole paragraph (the editor's own fragment form),
|
|
35
|
+
* marked as a tracked insertion by `revision` when one is given.
|
|
36
|
+
*/
|
|
37
|
+
export declare function captionFragmentHtml(label: string, number: number, text: string, revision?: Revision | null): string;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word's Layout presets — Margins, Size and Orientation — as page-setup updates in twips, the
|
|
3
|
+
* unit `w:pgSz`/`w:pgMar` and the engine's `setPageSetup` use. Pure, so the ribbon's choices and
|
|
4
|
+
* the preset a section already matches are tested without an editor.
|
|
5
|
+
*/
|
|
6
|
+
import type { PageSetup } from '@docx-editor.dev/react';
|
|
7
|
+
export declare const TWIPS_PER_INCH = 1440;
|
|
8
|
+
export interface MarginPreset {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Twips. */
|
|
12
|
+
top: number;
|
|
13
|
+
right: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
left: number;
|
|
16
|
+
}
|
|
17
|
+
/** Word's Margins gallery (Mirrored is a binding option the engine does not write). */
|
|
18
|
+
export declare const MARGIN_PRESETS: readonly MarginPreset[];
|
|
19
|
+
export interface PaperSize {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
/** Portrait width and height, in twips. */
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
/** Word's Size gallery: the paper sizes people actually pick. */
|
|
27
|
+
export declare const PAPER_SIZES: readonly PaperSize[];
|
|
28
|
+
/** The margin preset the section matches, if any (the gallery marks it as current). */
|
|
29
|
+
export declare function matchMargins(setup: PageSetup | null): string | null;
|
|
30
|
+
/** The paper size the section matches in either orientation, if any. */
|
|
31
|
+
export declare function matchPaper(setup: PageSetup | null): string | null;
|
|
32
|
+
/** A paper size's dimensions laid the way the section is turned, so picking a size keeps it. */
|
|
33
|
+
export declare function orientedSize(paper: PaperSize, orientation: PageSetup['orientation'] | undefined): {
|
|
34
|
+
pageWidthTwips: number;
|
|
35
|
+
pageHeightTwips: number;
|
|
36
|
+
};
|
|
37
|
+
/** `1440` -> `1"`, `1080` -> `0.75"`: how the gallery describes a margin. */
|
|
38
|
+
export declare function inches(twips: number): string;
|
|
39
|
+
/** `Letter` -> `8.5" × 11"`. */
|
|
40
|
+
export declare function paperDescription(paper: PaperSize): string;
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkQI6AIHWP_cjs = require('./chunk-QI6AIHWP.cjs');
|
|
5
|
-
var chunkHBF4BDRU_cjs = require('./chunk-HBF4BDRU.cjs');
|
|
6
5
|
var chunk46IU3UPF_cjs = require('./chunk-46IU3UPF.cjs');
|
|
6
|
+
var chunkHBF4BDRU_cjs = require('./chunk-HBF4BDRU.cjs');
|
|
7
7
|
var chunk65THHQVB_cjs = require('./chunk-65THHQVB.cjs');
|
|
8
8
|
var chunk7QDX2CO4_cjs = require('./chunk-7QDX2CO4.cjs');
|
|
9
9
|
var chunkMJCCBMM5_cjs = require('./chunk-MJCCBMM5.cjs');
|
|
@@ -966,6 +966,10 @@ Object.defineProperty(exports, "stripMarkdownLinks", {
|
|
|
966
966
|
enumerable: true,
|
|
967
967
|
get: function () { return chunkQI6AIHWP_cjs.stripMarkdownLinks; }
|
|
968
968
|
});
|
|
969
|
+
Object.defineProperty(exports, "UsageMeter", {
|
|
970
|
+
enumerable: true,
|
|
971
|
+
get: function () { return chunk46IU3UPF_cjs.UsageMeter; }
|
|
972
|
+
});
|
|
969
973
|
Object.defineProperty(exports, "ActionCluster", {
|
|
970
974
|
enumerable: true,
|
|
971
975
|
get: function () { return chunkHBF4BDRU_cjs.ActionCluster; }
|
|
@@ -1142,10 +1146,6 @@ Object.defineProperty(exports, "workspaceKindMeta", {
|
|
|
1142
1146
|
enumerable: true,
|
|
1143
1147
|
get: function () { return chunkHBF4BDRU_cjs.workspaceKindMeta; }
|
|
1144
1148
|
});
|
|
1145
|
-
Object.defineProperty(exports, "UsageMeter", {
|
|
1146
|
-
enumerable: true,
|
|
1147
|
-
get: function () { return chunk46IU3UPF_cjs.UsageMeter; }
|
|
1148
|
-
});
|
|
1149
1149
|
Object.defineProperty(exports, "ArticleList", {
|
|
1150
1150
|
enumerable: true,
|
|
1151
1151
|
get: function () { return chunk65THHQVB_cjs.ArticleList; }
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { ApplyLabelButton, ApplyLabelDialog, DEFAULT_APPLY_LABEL_DIALOG_LABELS, DEFAULT_RELEVANCE_STEPS, DEFAULT_SEARCH_BAR_LABELS, DEFAULT_SEARCH_EMPTY_STATE_LABELS, DEFAULT_SEARCH_GROUP_HEADER_LABELS, DEFAULT_SEARCH_NO_RESULTS_LABELS, DEFAULT_SEARCH_PAGINATION_LABELS, DEFAULT_SEARCH_TOTALS_LABELS, DOCUMENT_SEARCH_NOUNS, Highlight, RelevanceThreshold, SearchBar, SearchControlsBar, SearchEmptyState, SearchErrorBanner, SearchGroupCard, SearchGroupHeader, SearchNoResults, SearchPageBody, SearchPageFrame, SearchPageHeader, SearchPagination, SearchPillToggle, SearchResultList, SearchResultsInner, SearchResultsMain, SearchToolbarRow, SearchTotalsHeadline, getPageNumbers, highlightTerms, searchNouns, splitByTerms, stripMarkdownLinks } from './chunk-2MJWWPHY.js';
|
|
3
|
-
export { ActionCluster, AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_SIDEBAR_LABELS, DEFAULT_TIP_CARD_LABELS, DEFAULT_WORKSPACE_KIND_LABELS, DEFAULT_WORKSPACE_SWITCHER_LABELS, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, NotificationBell, OfflinePill, RemoteControlPill, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, Sidebar, SidebarBadgeRow, SidebarRowAction, SidebarRowHoverContext, SplitLayout, StatusBadge, StatusRow, TipCard, UserMenu, WorkspaceIdentity, WorkspaceSwitcher, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useInstallPrompt, useSidebarContext, useSidebarSettle, workspaceKindColor, workspaceKindMeta } from './chunk-VLOPZHFH.js';
|
|
4
3
|
export { UsageMeter } from './chunk-D5T53XCL.js';
|
|
4
|
+
export { ActionCluster, AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_SIDEBAR_LABELS, DEFAULT_TIP_CARD_LABELS, DEFAULT_WORKSPACE_KIND_LABELS, DEFAULT_WORKSPACE_SWITCHER_LABELS, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, NotificationBell, OfflinePill, RemoteControlPill, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, Sidebar, SidebarBadgeRow, SidebarRowAction, SidebarRowHoverContext, SplitLayout, StatusBadge, StatusRow, TipCard, UserMenu, WorkspaceIdentity, WorkspaceSwitcher, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useInstallPrompt, useSidebarContext, useSidebarSettle, workspaceKindColor, workspaceKindMeta } from './chunk-VLOPZHFH.js';
|
|
5
5
|
export { ArticleList, Chart, CheckList, CollectionDetail, CtaBand, DefinitionList, EditorialHeading, EditorialHero, EditorialProse, EditorialSection, Eyebrow, PanelGrid, ProofStrip, PullQuote, Reveal, TagList } from './chunk-LYUO3E6V.js';
|
|
6
6
|
export { DataTable, DataTableBlock, MetricCard, PageHeader, StatGroup } from './chunk-ZCF2JJFA.js';
|
|
7
7
|
export { Accordion, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Columns, ContactForm, Container, FAQ, FONT_PAIRINGS, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, ProfileCard, RichTextBlock, SectionHeading, Spacer, Steps, THEME_STYLE_ID, Tabs, TeamGrid, Testimonial, TestimonialGrid, ThemeEditor, VideoEmbed, applyFontVars, applyStoredTheme, applyThemeVars, clearFontVars, clearThemeVars, createThemeStore, fontPackages, getFontPairing, matchFontPairing, tid, toEmbedUrl, toHslTriplet } from './chunk-DLBUFHLY.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/blocks",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.101",
|
|
4
4
|
"description": "Composable, domain-neutral UI blocks for ARBI apps, organised by capability (retrieval, facts, agents, workspaces, citations, collaboration) plus shell, theme and site primitives, on top of @arbidocs/react.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -252,6 +252,7 @@
|
|
|
252
252
|
"src/components/grid.css",
|
|
253
253
|
"src/source.css",
|
|
254
254
|
"src/docx/styles.css",
|
|
255
|
+
"src/docx/layout/layout.css",
|
|
255
256
|
"src/docx/README.md",
|
|
256
257
|
"src/calendar/calendar.css"
|
|
257
258
|
],
|
|
@@ -266,8 +267,8 @@
|
|
|
266
267
|
"example:test:e2e": "playwright test -c examples/custom-ui/playwright.config.ts"
|
|
267
268
|
},
|
|
268
269
|
"dependencies": {
|
|
269
|
-
"@arbidocs/client": "0.4.
|
|
270
|
-
"@arbidocs/coedit": "0.4.
|
|
270
|
+
"@arbidocs/client": "0.4.101",
|
|
271
|
+
"@arbidocs/coedit": "0.4.101",
|
|
271
272
|
"@dnd-kit/core": "^6.3.1",
|
|
272
273
|
"@dnd-kit/sortable": "^10.0.0",
|
|
273
274
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -293,7 +294,7 @@
|
|
|
293
294
|
"zustand": "^5.0.14"
|
|
294
295
|
},
|
|
295
296
|
"peerDependencies": {
|
|
296
|
-
"@arbidocs/react": "0.4.
|
|
297
|
+
"@arbidocs/react": "0.4.101",
|
|
297
298
|
"@docx-editor.dev/core": "2.28.0",
|
|
298
299
|
"@docx-editor.dev/react": "2.28.0",
|
|
299
300
|
"@lexical/html": "0.35.0",
|
package/src/docx/README.md
CHANGED
|
@@ -68,12 +68,33 @@ Word redline. Pass `baseId`, `revisedId`, `title` and optionally `onCompared` to
|
|
|
68
68
|
refresh only the generated document in your host cache. Source files stay intact.
|
|
69
69
|
|
|
70
70
|
Defined terms: give the adapter `definitions` (the workspace's facts labelled "Definitions", as
|
|
71
|
-
`DefinitionSource`s) and the Insert tab offers Defined term
|
|
71
|
+
`DefinitionSource`s) and the Insert tab offers Defined term, and typing
|
|
72
72
|
`@@` in the body opens the term type-ahead. A picked term is inserted as an internal link
|
|
73
73
|
(`w:hyperlink w:anchor`, the definition as its tooltip) to a hidden `_dt_<fact id>` bookmark on
|
|
74
74
|
its definition, which is added in alphabetical order to the document's Definitions section (a
|
|
75
75
|
heading named "Definitions"/"Definitions and interpretation"…, else a new "Definitions" heading at
|
|
76
|
-
the end). Hovering a term shows its definition.
|
|
77
|
-
rewords and reorders the ones the section has, and lists those never used. The terms are read from
|
|
76
|
+
the end). Hovering a term shows its definition. The terms are read from
|
|
78
77
|
the facts with `parseDefinition`/`groupDefinitions` (root entry), which also print the glossary
|
|
79
78
|
(`glossaryDocx`, `glossaryMarkdown`).
|
|
79
|
+
|
|
80
|
+
Layout, tables and pictures (`layout/`): the ribbon's Layout tab offers Margins, Orientation and
|
|
81
|
+
Size galleries (written to the caret's section with `setPageSetup`), Breaks (page, next-page and
|
|
82
|
+
continuous section breaks) and the engine's Page Setup dialog. The contextual Table tab (caret in a
|
|
83
|
+
table) inserts and deletes rows and columns, aligns cells and carries the engine's border and
|
|
84
|
+
shading chrome. Tab and Shift+Tab move between cells and Tab in the last cell adds a row, as in
|
|
85
|
+
Word (the engine would type a tab character). The contextual Picture tab (picture selected) offers wrap, size and position, alt
|
|
86
|
+
text, rotate and flip, and Insert caption (a `Caption`-style paragraph numbered by a `SEQ` field).
|
|
87
|
+
Give the adapter `imageGeneration` and Insert offers Generate image: the picture comes back as an
|
|
88
|
+
ordinary inline picture at the caret, its alt text the prompt, its bytes a media part of the DOCX.
|
|
89
|
+
|
|
90
|
+
What the engine does not do yet, so the ribbon shows it disabled with the engine's reason:
|
|
91
|
+
|
|
92
|
+
- Text columns: `w:cols` in an opened document lay out and save unchanged, but no command writes
|
|
93
|
+
them (`setPageSetup` has no columns field, a pasted `w:sectPr` is dropped, and the `column`
|
|
94
|
+
break is refused).
|
|
95
|
+
- Merge and split cells, repeat header row (`mergeCells`, `splitCell`, `toggleHeaderRow` are
|
|
96
|
+
refused); table properties (`setTableProperties`) has no tree-editor implementation.
|
|
97
|
+
- Wrap text on an inline picture: only a picture that is already floating can change wrap.
|
|
98
|
+
- Picture edits (wrap, resize, rotate) and a continuous section break cannot be suggested:
|
|
99
|
+
switch Review › Editing mode to Editing first. Inserting a picture or a table is tracked as an
|
|
100
|
+
insertion.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* Layout, Table and Picture tabs, Generate image and Insert caption (src/docx/layout). */
|
|
2
|
+
.native-docx-gallery {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: 100%;
|
|
6
|
+
gap: 2px;
|
|
7
|
+
}
|
|
8
|
+
.native-docx-gallery > button {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 6px 8px;
|
|
13
|
+
border: 0;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
background: transparent;
|
|
16
|
+
color: inherit;
|
|
17
|
+
text-align: left;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font: inherit;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
}
|
|
22
|
+
.native-docx-gallery-text {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 1px;
|
|
26
|
+
}
|
|
27
|
+
.native-docx-gallery-label {
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
}
|
|
30
|
+
.native-docx-gallery-detail {
|
|
31
|
+
color: hsl(var(--muted-foreground));
|
|
32
|
+
font-size: 11px;
|
|
33
|
+
}
|
|
34
|
+
.native-docx-gallery > button:hover:not(:disabled) {
|
|
35
|
+
background: hsl(var(--muted));
|
|
36
|
+
}
|
|
37
|
+
.native-docx-gallery > button[aria-checked='true'] {
|
|
38
|
+
box-shadow: inset 3px 0 hsl(var(--primary));
|
|
39
|
+
background: hsl(var(--muted));
|
|
40
|
+
}
|
|
41
|
+
.native-docx-gallery > button:disabled {
|
|
42
|
+
cursor: default;
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
}
|
|
45
|
+
.native-docx-gallery-more {
|
|
46
|
+
width: 100%;
|
|
47
|
+
padding: 6px 8px;
|
|
48
|
+
border: 0;
|
|
49
|
+
border-top: 1px solid hsl(var(--border));
|
|
50
|
+
background: transparent;
|
|
51
|
+
color: hsl(var(--primary));
|
|
52
|
+
text-align: left;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
font: inherit;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
}
|
|
57
|
+
.native-docx-form {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
}
|
|
64
|
+
.native-docx-form label {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 4px;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
}
|
|
70
|
+
.native-docx-form input,
|
|
71
|
+
.native-docx-form select,
|
|
72
|
+
.native-docx-form textarea {
|
|
73
|
+
padding: 4px 8px;
|
|
74
|
+
border: 1px solid hsl(var(--border));
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
background: hsl(var(--background));
|
|
77
|
+
color: hsl(var(--foreground));
|
|
78
|
+
font: inherit;
|
|
79
|
+
font-weight: 400;
|
|
80
|
+
}
|
|
81
|
+
.native-docx-form textarea {
|
|
82
|
+
resize: vertical;
|
|
83
|
+
}
|
|
84
|
+
.native-docx-form p {
|
|
85
|
+
margin: 0;
|
|
86
|
+
color: hsl(var(--muted-foreground));
|
|
87
|
+
}
|
|
88
|
+
.native-docx-form p[role='alert'] {
|
|
89
|
+
color: hsl(var(--destructive));
|
|
90
|
+
}
|
|
91
|
+
.native-docx-form button,
|
|
92
|
+
.native-docx-form-actions button {
|
|
93
|
+
align-self: flex-end;
|
|
94
|
+
padding: 4px 12px;
|
|
95
|
+
border: 1px solid hsl(var(--border));
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
background: hsl(var(--primary));
|
|
98
|
+
color: hsl(var(--primary-foreground));
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
font: inherit;
|
|
101
|
+
}
|
|
102
|
+
.native-docx-form button:disabled {
|
|
103
|
+
cursor: default;
|
|
104
|
+
opacity: 0.5;
|
|
105
|
+
}
|
|
106
|
+
.native-docx-form-actions {
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: flex-end;
|
|
109
|
+
}
|
|
110
|
+
.native-docx-generate-image {
|
|
111
|
+
width: 300px;
|
|
112
|
+
}
|
|
113
|
+
.native-docx-spin {
|
|
114
|
+
animation: native-docx-spin 1s linear infinite;
|
|
115
|
+
}
|
|
116
|
+
@keyframes native-docx-spin {
|
|
117
|
+
to {
|
|
118
|
+
transform: rotate(360deg);
|
|
119
|
+
}
|
|
120
|
+
}
|