@polycyphers/bim 0.1.6 → 0.2.0

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.
@@ -1,2 +1,37 @@
1
1
  import type { Lang } from './types';
2
2
  export declare function w(lang: Lang, label: string): string;
3
+ /** Translate a template, then fill `{name}` slots. Values are inserted after translation, never looked up. */
4
+ export declare function wf(lang: Lang, label: string, values: Record<string, string | number | undefined>): string;
5
+ /** Number and date locale. Arabic uses Western digits (owner copy review, 2026-11). */
6
+ export declare function numberLocale(lang: Lang): "en" | "de" | "fr" | "ar-u-nu-latn";
7
+ /** CLDR plural category for a count in the studio language (Arabic: zero/one/two/few/many/other). */
8
+ export declare function pluralCategory(lang: Lang, count: number): Intl.LDMLPluralRule;
9
+ /** Plural-aware `wf`: picks the form for `count`, falling back to the reviewed "other" label. */
10
+ export declare function wp(lang: Lang, label: string, count: number, values?: Record<string, string | number | undefined>): string;
11
+ /** Paid-project caps line; every count agrees with its own noun. Arabic keeps the reviewed agreement-free "label: n" form. */
12
+ export declare function paidCapsText(lang: Lang, caps: {
13
+ regenerations: number;
14
+ chat: number;
15
+ exports: number;
16
+ }): string;
17
+ /** Display-only decimals: DE/FR decimal comma, EN/AR point, Western digits everywhere. Never use for payloads, SVG geometry or exports. */
18
+ export declare function formatDecimal(lang: Lang, value: number | null | undefined, digits: number): string;
19
+ /** Languages whose users type a decimal comma. */
20
+ export declare function decimalComma(lang: Lang): lang is "de" | "fr";
21
+ /** Typed decimal text → the canonical form a number input would report: "3,2" and "3.2" → "3.2"; partial "3," → "3."; anything else → "" (as a native number input sanitizes it). */
22
+ export declare function normalizeDecimalText(raw: string): string;
23
+ /** Parse typed decimal text, accepting a comma; empty or invalid text is NaN. */
24
+ export declare function parseDecimal(raw: string): number;
25
+ /** Display an arbitrary-precision value exactly as stored, with the language's decimal separator. */
26
+ export declare function plainDecimal(lang: Lang, value: number): string;
27
+ /** Unit symbol as shown to the reader: Latin symbols in EN/DE/FR, Arabic symbols (م، سم، مم، م²) in AR. */
28
+ export declare function unitLabel(lang: Lang, unit: string): string;
29
+ /** A formatted number and its unit; DE/FR keep them together with U+00A0. */
30
+ export declare function withUnit(lang: Lang, value: string, unit: string): string;
31
+ /** Free-tier line; each count agrees with its noun. Arabic uses the agreement-free "label: n" form of the reviewed caps line. */
32
+ export declare function freeAllowanceText(lang: Lang, allowance: {
33
+ proposals: number;
34
+ exports: number;
35
+ }): string;
36
+ /** Translated label for an engine status value; EN and unknown values show the raw value. */
37
+ export declare function statusLabel(lang: Lang, status: string | null | undefined): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polycyphers/bim",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -20,10 +20,12 @@
20
20
  "import": "./dist/index.mjs",
21
21
  "require": "./dist/index.cjs"
22
22
  },
23
- "./style.css": "./dist/style.css"
23
+ "./style.css": "./dist/style.css",
24
+ "./studio.css": "./dist/studio.css",
25
+ "./fonts.css": "./dist/fonts.css"
24
26
  },
25
27
  "scripts": {
26
- "build": "node scripts/prepare-build.mjs && tsc --emitDeclarationOnly && vite build",
28
+ "build": "node scripts/prepare-build.mjs && tsc --emitDeclarationOnly && vite build && node scripts/split-css.mjs",
27
29
  "prepack": "npm run build",
28
30
  "test": "node --experimental-strip-types --test tests/*.test.mjs && vitest run",
29
31
  "verify:package": "npm run build && npm test && node scripts/verify-package.mjs",