Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: 9
version: 10.33.4

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -77,9 +77,9 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: 9
version: 10.33.4

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Core packages live under `packages/`:

## Tooling

- Package manager: `pnpm` (repo expects `pnpm@9.15.9`).
- Package manager: `pnpm` (repo expects `pnpm@10.33.4` per root `packageManager`; `engines.pnpm` is `>=10`).
- Language: TypeScript (ESM).
- Demos use Vite (`pnpm --filter <pkg> dev`).

Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"name": "mtext-input-box-monorepo",
"private": true,
"packageManager": "pnpm@9.15.9",
"packageManager": "pnpm@10.33.4",
"engines": {
"pnpm": ">=10"
},
"pnpm": {
"onlyBuiltDependencies": [
"@parcel/watcher",
"esbuild",
"nx",
"vue-demi"
]
},
"scripts": {
"build": "pnpm --filter @mlightcad/text-box-cursor build && pnpm --filter @mlightcad/mtext-input-box build && pnpm --filter @mlightcad/demo-canvas-cursor build && pnpm --filter @mlightcad/demo-three-cursor build && pnpm --filter @mlightcad/demo-mtext-input-box build",
"dev:canvas": "pnpm --filter @mlightcad/demo-canvas-cursor dev",
Expand Down
1 change: 1 addition & 0 deletions packages/demo-canvas-cursor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@mlightcad/text-box-cursor": "workspace:*"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@types/node": "^24.4.0",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
Expand Down
1 change: 1 addition & 0 deletions packages/demo-mtext-input-box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"vue": "^3.5.22"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@types/diff": "^7.0.1",
"@types/node": "^24.4.0",
"@types/three": "^0.172.0",
Expand Down
1 change: 1 addition & 0 deletions packages/demo-three-cursor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@mlightcad/text-box-cursor": "workspace:*"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@types/node": "^24.4.0",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/mtext-input-box/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mlightcad/mtext-input-box",
"version": "0.2.7",
"version": "0.2.8",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -22,10 +22,11 @@
"@mlightcad/text-box-cursor": "workspace:*"
},
"peerDependencies": {
"@mlightcad/mtext-renderer": "^0.10.11",
"@mlightcad/mtext-renderer": "^0.10.13",
"three": "^0.172.0"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@types/node": "^24.4.0",
"@types/three": "^0.172.0",
"@typescript-eslint/eslint-plugin": "^8.41.0",
Expand Down
13 changes: 11 additions & 2 deletions packages/mtext-input-box/src/viewer/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CharFormat } from './types';
import { MTextParagraphAlignment } from '@mlightcad/mtext-renderer';

export const DEFAULT_FONT_FAMILY = 'simkai';

Expand All @@ -14,7 +15,11 @@ export function defaultCharFormat(): CharFormat {
strike: false,
script: 'normal',
aci: null,
rgb: 0xffffff
rgb: 0xffffff,
obliqueAngle: 0,
widthFactor: 1,
tracking: 1,
paragraphAlignment: MTextParagraphAlignment.DEFAULT
};
}

Expand All @@ -30,6 +35,10 @@ export function sameFormat(a: CharFormat, b: CharFormat): boolean {
a.strike === b.strike &&
a.script === b.script &&
a.aci === b.aci &&
a.rgb === b.rgb
a.rgb === b.rgb &&
a.obliqueAngle === b.obliqueAngle &&
a.widthFactor === b.widthFactor &&
a.tracking === b.tracking &&
a.paragraphAlignment === b.paragraphAlignment
);
}
23 changes: 22 additions & 1 deletion packages/mtext-input-box/src/viewer/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type { Box, CursorStyle, SelectionStyle } from '@mlightcad/text-box-cursor';
import type { ColorSettings, MTextColor, TextStyle } from '@mlightcad/mtext-renderer';
import type {
ColorSettings,
MTextColor,
MTextParagraphAlignment,
TextStyle
} from '@mlightcad/mtext-renderer';
import type * as THREE from 'three';

/** Vertical script style for a character run. */
Expand All @@ -26,6 +31,22 @@ export interface CharFormat {
aci: number | null;
/** Explicit RGB color packed as `0xRRGGBB`. */
rgb: number | null;
/**
* Character slant in degrees (AutoCAD oblique; negative leans the other way).
* Serialized to MTEXT as `\Qangle;`.
*/
obliqueAngle: number;
/** Horizontal scale of characters (width factor). Serialized as `\Wvalue;`. */
widthFactor: number;
/**
* Inter-character spacing factor (MTEXT `\T` tracking). `1` is the default spacing.
*/
tracking: number;
/**
* Paragraph horizontal alignment for the active paragraph (cursor or selection).
* Uses {@link MTextParagraphAlignment} from the shared MTEXT stack (parser / renderer).
*/
paragraphAlignment: MTextParagraphAlignment;
}

/** Internal editor state snapshot used for updates and history-like operations. */
Expand Down
Loading
Loading