UnifiedWriter ========= UnifiedWriter is an AMD package for a single-file document editing tool. Entry: scripts/main.js Basic Host usage: require.config({ paths:{ UnifiedWriter:'/scripts' } }); require(['UnifiedWriter/main'], function(UnifiedWriter){ const control = UnifiedWriter.createControl({ container:'#target', language:'ja', OpenFile: hostOpenFile, SaveFile: hostSaveFile }); }); Native work file: .uwpsx, ZIP based package. Demos: demo/index.html demo/basic.html demo/parameters.html demo/callback-io.html demo/oneeditor-integration.html Run demos over HTTP, not file://. Native editor: UnifiedWriter uses a Model-first editing engine with a hidden input proxy; rendered pages are not contenteditable and Simditor is not required. Development build dev-5.23.0: - Renamed OfficeDoc to UnifiedWriter across package root, AMD alias, plugin name, public context, docs and demo labels. - Kept .uwpsx as the native Unified Word Processing document package format. - Preserved the dev-5.22.2 Model-first list, selection and undo stability baseline. Development build dev-5.21.5: - Refined toolbar to match Google Docs more closely: paragraph style and font size remain dropdowns, while bullet and numbered list are separate command buttons. - Improved B/I/U active state calculation from ModelSelection and block HTML instead of focused DOM / input proxy. - Added active states for bullet and numbered list buttons. - Added Google Docs-like toolbar buttons for Normal/H1/H2/H3, font size 12/14/18, bulleted list and numbered list. - Improved model-first ArrowUp/ArrowDown to use rendered caret geometry instead of block-only movement. - Wired toolbar Undo/Redo to the model undo stack. Development build dev-5.21.0: The editor input path was rebuilt as a model-first pipeline. Normal typing, Enter, delete and paste are converted to DocumentModel operations, then rendered through the common block-flow pagination engine. ## dev-5.24.0 notes UnifiedWriter now includes a Google Docs-compatible feature map panel and expanded UI entry points for Insert / Format / Tools categories. DOCX Import Beta uses an OOXML-first parser in `scripts/addons/docx_io.js` and keeps Mammoth only as a fallback. See `docs/GOOGLE_DOCS_FEATURE_MAP.md` and `docs/DOCX_IMPORT_ARCHITECTURE.md`. ## Development build dev-5.27.2 This build adds Google Docs-style compact menu density and exposes text color, highlight color, paragraph alignment, line spacing, and paragraph indent/outdent directly on the toolbar. These toolbar actions reuse the same Model-first formatting operations as the Format menu. ## Development build dev-5.27.0 This build consolidates v5.25.0-v5.27.0 scope: - Google Docs-style Japanese menu/toolbar/pane refinement. - Model-first paragraph formatting: alignment, line spacing, indent/outdent. - Inline text formatting: text color and highlight color. - Clear formatting now clears block-level style metadata as well as inline marks. - DOCX Import Level 1-2 practical improvement: OOXML headings, runs, lists, images, hyperlinks, paragraph alignment, line spacing and indents. - Browser alert/confirm/prompt paths in comments/history were replaced with jQuery UI dialogs. ## Development build dev-5.27.2 - Reorganized the 書式 / Format menu into Google Docs-style grouped submenus: Text, Paragraph styles, Align and indent, Line and paragraph spacing, Columns, Bullets and numbering, Headers/footers, Page numbers, Page orientation, Table, Image, Borders and lines. - Supported commands continue to share the same Model-first operations as the toolbar; planned groups show reviewable UI entry points without reverting to DOM-first editing. - Compact menu CSS was tightened for Japanese group labels and nested submenu readability. ## Development build dev-5.28.0 This build focuses on the editing core stability required before adding larger features such as tables and high-fidelity DOCX round-trip: - SelectionController-driven toolbar state is strengthened for paragraph style, B/I/U, lists, alignment and line spacing. - Collapsed selection formatting stores a Model typing state, so commands such as Bold, text color and highlight can affect the next typed text without patching the rendered DOM. - Typing and one-character deletion preserve surrounding inline run metadata such as bold, color, highlight and font size. - IME composition is guarded and committed as a single Model-first operation. - Undo/Redo snapshots now preserve selection anchor and pending inline typing state. See `docs/SELECTION_TOOLBAR_FORMAT_STABILITY.md`. Dev 5.35.0: Editing stability/regression hardening for selection modes, object selections, Undo/Redo, IME and clipboard paths. UnifiedWriter v5.64.2: EditorControl now supports edit/view modes. OneViewer should use EditorControl with mode=view; ViewerControl is no longer an official separate Control variant. UnifiedWriter v5.64.3: Workbench menu geometry was tightened for Japanese Format/View menus, and the right-pane Outline tab is hidden when the left Outline pane is visible to avoid duplicate Outline display. UnifiedWriter v5.65.1: Added a dedicated Development menu. Superseded by v5.65.2 for the exact Development/Help responsibility boundary. UnifiedWriter v5.65.0: Aligned package File command / Workbench File menu / OneEditor delegation wording with policy v1.8 and single-file policy v1.2. Added getFileCapabilities(), view/readOnly command guards, Workbench view-mode menu/toolbar pruning, and demo/oneeditor-integration.html. UnifiedWriter v5.65.2: Corrected the Development menu responsibility. Development is for EndUser macro/script authoring, inspection, execution and conversion. Internal package-development diagnostics remain under Help during development builds and are product-build removal candidates. UnifiedWriter v5.65.3: Flattened the EndUser-facing Development menu. Macro diagnostics, VBA code viewer, Script engine and VBA-to-JS translator now appear directly under Development without an extra first-level Macros submenu. Internal package-development diagnostics remain under Help. v5.66.3 UnifiedControl Framework note ------------------------------------ UnifiedWriter now requires the common UnifiedControl package as a peer AMD dependency. Configure RequireJS aliases for both packages before loading UnifiedWriter/main: UnifiedControl package root -> https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/ (Demo derives the RequireJS scripts alias by appending /scripts) UnifiedWriter -> /scripts The public Control classes are scripts/controls/editor_control.js and scripts/controls/workbench_control.js. Both inherit UnifiedControl.Control. UnifiedControl is not copied into this ZIP; use the internal development CDN root https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/ during package development. v5.66.3 UnifiedControl CDN reference ----------------------------------- UnifiedControl is hosted at: https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/ UnifiedWriter must not download or copy UnifiedControl into its package. During development, Demo/Host RequireJS configuration should map: UnifiedControl -> https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/scripts v5.66.3 UnifiedControl package-root reference ------------------------------------------- UnifiedControl is referenced by package root URL, not copied into UnifiedWriter: https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/ Demo code derives the RequireJS alias as: UnifiedControl -> https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/scripts The demo parameter ?ucRoot now means the UnifiedControl package root URL. Values ending in /scripts are still accepted only for compatibility. ## v5.66.3 UnifiedControl direct base Control import UnifiedWriter still treats UnifiedControl as a peer package referenced by package root URL and does not copy it into the Writer ZIP. To avoid loading optional UnifiedControl Content/Designer modules during app boot, EditorControl imports the required base class from `UnifiedControl/controls/control` rather than `UnifiedControl/main`. Host/Demo RequireJS aliases remain the same: `UnifiedControl` points to `/scripts` and `UnifiedWriter` points to `/scripts`. Dev 5.66.4 note: superseded by dev-5.66.5. The local mini AMD loader is no longer used. Dev 5.66.5 RequireJS loader note --------------------------------- All UnifiedWriter demos now use official RequireJS 2.3.6 instead of the former local mini AMD loader: https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.js Demos configure the AMD aliases as: UnifiedControl -> https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/scripts UnifiedWriter -> ../scripts The local scripts/vendor/require.js mini loader is not shipped and must not be used as the AMD loader. UnifiedWriter v5.66.6: scripts/ AMD module physical filenames are standardized to lower_snake_case.js. Public classes and APIs remain unchanged. UnifiedControl dev-0.7.2 direct module paths also use lower_snake_case, so the base Control import is `UnifiedControl/controls/control`. ## dev-5.67.0 - Adopted app development policy v1.10 CSS / Theme / Manifest contract. - Added `PACKAGE_MANIFEST.json.styles` and `styleScope` for Host pre-mount CSS loading. - Renamed package CSS to `themes/base/unified_writer.css` and `themes/flat/unified_writer.css`. - Added `.uwriter` root class scoping and removed package CSS dependence on generic `body` selectors. - Adopted single-file processing policy v1.3 Programable Editing Control APIs: `openFile`, `saveFile`, `saveAsFile`, `exportFile`. ## v5.67.1 Demo File Save Policy Alignment Demo SaveFile callbacks now follow the single-file policy v1.3 direction split: Workbench/Command obtains or generates a HostSavePayload/v1 with payload.data, then the Demo Host SaveFile callback writes that data by using a local-device download adapter. Demo code does not mark App Storage as the user-facing save destination and does not save without payload.data. Save As dialogs use the package overlay class `uwriter-floating-ui` so file-save UI remains scoped under the v1.10 CSS/Theme contract. ## dev-5.67.2 Demo Local Disk Save update Demo pages now implement Host-side Local Disk file selection for OpenFile / SaveFile callbacks. On browsers with the File System Access API, Open uses `showOpenFilePicker()` and Save / Save As uses `showSaveFilePicker()` plus writable file handles. `HostSavePayload/v1.payload.data` is the only write source. FileSaver/download is kept only as an unsupported-browser fallback.