@weasel-js/core 0.7.0 → 0.7.2
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/CHANGELOG.md +126 -0
- package/dist/{chunk-7F3SDUJ4.js → chunk-5F3PIERN.js} +1555 -1151
- package/dist/chunk-5F3PIERN.js.map +1 -0
- package/dist/{chunk-FSZEXVCR.js → chunk-SYM6RAM4.js} +66 -5
- package/dist/chunk-SYM6RAM4.js.map +1 -0
- package/dist/{index-D31EADQG.d.ts → index-DOYRTfP0.d.ts} +156 -17
- package/dist/index.d.ts +352 -26
- package/dist/index.js +2 -2
- package/dist/renderer.d.ts +26 -2
- package/dist/renderer.js +2 -2
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +1 -1
- package/package.json +15 -14
- package/dist/chunk-7F3SDUJ4.js.map +0 -1
- package/dist/chunk-FSZEXVCR.js.map +0 -1
package/dist/renderer.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { V as ViewLike, v as viewToMat3 } from './viewToMat3-D4lrBigW.js';
|
|
|
3
3
|
import { G as GradStop, M as Mat3, S as ShaderProgramHandle, D as DrawCommand, a as Stroke } from './DrawCommand-CJtqqt8H.js';
|
|
4
4
|
export { b as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, c as ShaderDrawCommand, d as ShaderUniform, e as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-CJtqqt8H.js';
|
|
5
5
|
import { P as Path } from './types-B6MMiodD.js';
|
|
6
|
-
export { isCanvasFont, registerCanvasFont, registerFont, subscribeGlyphReady, unregisterCanvasFont } from '@weasel-js/font';
|
|
6
|
+
export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
7
7
|
export { T as TextureHandle, r as registerTexture } from './registerTexture-BzHTLhD9.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -249,6 +249,14 @@ interface WeaselRendererOptions {
|
|
|
249
249
|
* Default DEFAULT_BAKE_BUDGET (16). The headless renderSceneToPixels
|
|
250
250
|
* path passes Infinity so print never defers a glyph. */
|
|
251
251
|
bakeBudget?: number;
|
|
252
|
+
/** On-screen glyph size, in CSS pixels, at or above which text renders from
|
|
253
|
+
* tessellated font outlines instead of a distance field — see
|
|
254
|
+
* `OUTLINE_MIN_SCREEN_PX`. Only faces registered with
|
|
255
|
+
* `registerFontOutlines` are affected; everything else keeps its SDF tier
|
|
256
|
+
* whatever this says. Pass `Infinity` to disable the tier outright, or 0
|
|
257
|
+
* to use outlines wherever they exist (what the headless path does, since
|
|
258
|
+
* print has no reason to sample a field it could evaluate exactly). */
|
|
259
|
+
textOutlineMinScreenSize?: number;
|
|
252
260
|
}
|
|
253
261
|
declare class WeaselRenderer {
|
|
254
262
|
private readonly gl;
|
|
@@ -277,6 +285,7 @@ declare class WeaselRenderer {
|
|
|
277
285
|
private readonly imageMinification;
|
|
278
286
|
private readonly flattenTolerance?;
|
|
279
287
|
private readonly bakeBudget;
|
|
288
|
+
private readonly textOutlineMinScreenSize;
|
|
280
289
|
private contextLost;
|
|
281
290
|
private boundOnLost;
|
|
282
291
|
private boundOnRestored;
|
|
@@ -374,4 +383,19 @@ interface StrokeOptions {
|
|
|
374
383
|
*/
|
|
375
384
|
declare function tessellateStroke(path: Path, stroke: Stroke, opts?: StrokeOptions): Mesh;
|
|
376
385
|
|
|
377
|
-
|
|
386
|
+
/**
|
|
387
|
+
* On-screen glyph size (CSS px) at or above which a face with registered
|
|
388
|
+
* outlines is drawn as geometry instead of sampled from a distance field.
|
|
389
|
+
*
|
|
390
|
+
* 48 is the dynamic tier's own `BAKE_SIZE`, which makes it the size at which
|
|
391
|
+
* that tier stops being an interpolation and starts being a magnification:
|
|
392
|
+
* `glyphRasterizer.ts` measures coverage error bottoming out *at* the bake
|
|
393
|
+
* size and rising on both sides, and past a few times it the reconstructed
|
|
394
|
+
* field shows the raster as contour wobble. The same number is a safe
|
|
395
|
+
* crossing for the baked MSDF atlas, which is still crisp here — outlines are
|
|
396
|
+
* exact, so switching early costs nothing but the tessellation, and the
|
|
397
|
+
* hinting the atlas has and outlines don't stopped mattering well below this.
|
|
398
|
+
*/
|
|
399
|
+
declare const OUTLINE_MIN_SCREEN_PX = 48;
|
|
400
|
+
|
|
401
|
+
export { DrawCommand, IDENTITY_COLOR_MATRIX, ImageMinification, Mat3, type Mesh, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, ShaderProgramHandle, type StrokeOptions, type TessellateOptions, WeaselRenderer, type WeaselRendererOptions, buildGradientRamp, tessellate, tessellateStroke };
|
package/dist/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { IDENTITY_COLOR_MATRIX, ShaderCompileError, WeaselRenderer, buildGradientRamp, isCanvasFont, mat3, registerCanvasFont, registerFont, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, viewToMat3 } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-5F3PIERN.js';
|
|
2
|
+
import './chunk-SYM6RAM4.js';
|
|
3
3
|
import './chunk-VOVKONXA.js';
|
|
4
4
|
import './chunk-BGGZ4CVF.js';
|
|
5
5
|
import './chunk-CQNKCG34.js';
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aX as Conflict, aY as PREDICATE_TARGET, aZ as RegistryEntry, a_ as ToolDef, k as ToolKeybinding, a$ as ToolScopes, b0 as ViewportToolDef, b1 as buildRouteRegistry, b2 as defineTool, b3 as defineViewportTool, b4 as findConflicts, b5 as findScopedConflicts, b6 as formatConflict, b7 as reportRouteConflicts } from './index-DOYRTfP0.js';
|
|
2
2
|
export { ChannelRef, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, ModRequirement, ModifierKey, ParsedModifiers, ParsedRoute, PhaseAtom, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, RouteDescriptionPart, RouteFieldName, RouteTermLabel, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from '@weasel-js/gestures';
|
|
3
3
|
import './types-Cpb4hii1.js';
|
|
4
4
|
import '@weasel-js/history';
|
package/dist/routing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, defineTool, defineViewportTool, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from './chunk-
|
|
1
|
+
export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, defineTool, defineViewportTool, describeRoute, describeRouteParts, findConflicts, findScopedConflicts, formatConflict, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute, reportRouteConflicts } from './chunk-SYM6RAM4.js';
|
|
2
2
|
import './chunk-PZ5AY32C.js';
|
|
3
3
|
//# sourceMappingURL=routing.js.map
|
|
4
4
|
//# sourceMappingURL=routing.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Domain-agnostic 2D scene graph primitives for React: viewport math, drag/resize/insert/clone interactions, layered canvas rendering.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "orochi235",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"type": "module",
|
|
17
17
|
"sideEffects": false,
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
@@ -66,20 +66,25 @@
|
|
|
66
66
|
},
|
|
67
67
|
"./package.json": "./package.json"
|
|
68
68
|
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "tsup",
|
|
71
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
72
|
+
},
|
|
69
73
|
"peerDependencies": {
|
|
70
74
|
"react": ">=18"
|
|
71
75
|
},
|
|
72
76
|
"dependencies": {
|
|
73
|
-
"@weasel-js/font": "0.7.
|
|
74
|
-
"@weasel-js/geom": "0.7.
|
|
75
|
-
"@weasel-js/gestures": "0.7.
|
|
76
|
-
"@weasel-js/history": "0.7.
|
|
77
|
-
"@weasel-js/modes": "0.7.
|
|
77
|
+
"@weasel-js/font": "0.7.2",
|
|
78
|
+
"@weasel-js/geom": "0.7.2",
|
|
79
|
+
"@weasel-js/gestures": "0.7.2",
|
|
80
|
+
"@weasel-js/history": "0.7.2",
|
|
81
|
+
"@weasel-js/modes": "0.7.2",
|
|
78
82
|
"earcut": "2.2.4",
|
|
79
83
|
"polygon-clipping": "^0.15.7"
|
|
80
84
|
},
|
|
81
85
|
"publishConfig": {
|
|
82
|
-
"access": "public"
|
|
86
|
+
"access": "public",
|
|
87
|
+
"provenance": true
|
|
83
88
|
},
|
|
84
89
|
"keywords": [
|
|
85
90
|
"react",
|
|
@@ -89,9 +94,5 @@
|
|
|
89
94
|
"resize",
|
|
90
95
|
"viewport",
|
|
91
96
|
"2d"
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
"build": "tsup",
|
|
95
|
-
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
97
|
+
]
|
|
98
|
+
}
|