@pixerate/editor 0.87.0 → 0.89.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.
- package/THIRD_PARTY_NOTICES.md +8 -2
- package/dist/agent/index.cjs +28 -28
- package/dist/agent/index.js +3 -3
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.js +16 -16
- package/dist/{chunk-TYOAJDFD.cjs → chunk-66IMF6OD.cjs} +3 -3
- package/dist/{chunk-TYOAJDFD.cjs.map → chunk-66IMF6OD.cjs.map} +1 -1
- package/dist/chunk-D4ZCU72J.js +604 -0
- package/dist/chunk-D4ZCU72J.js.map +1 -0
- package/dist/{chunk-IMSX4IVG.js → chunk-FWEO3HSL.js} +4 -4
- package/dist/chunk-H543GD6T.cjs +1696 -0
- package/dist/chunk-H543GD6T.cjs.map +1 -0
- package/dist/{chunk-ROXFP2LQ.cjs → chunk-HNDSPZ5T.cjs} +4 -4
- package/dist/{chunk-ROXFP2LQ.cjs.map → chunk-HNDSPZ5T.cjs.map} +1 -1
- package/dist/{chunk-MXF4DP2C.cjs → chunk-J3B45HTA.cjs} +74 -74
- package/dist/{chunk-MXF4DP2C.cjs.map → chunk-J3B45HTA.cjs.map} +1 -1
- package/dist/{chunk-GNO5PEMH.js → chunk-OK7T2LHK.js} +2 -2
- package/dist/chunk-P5TPUNBZ.js +1696 -0
- package/dist/chunk-P5TPUNBZ.js.map +1 -0
- package/dist/chunk-PDCITYBT.cjs +416 -0
- package/dist/chunk-PDCITYBT.cjs.map +1 -0
- package/dist/{chunk-RKJDBXTY.cjs → chunk-T4XWVPJK.cjs} +3 -3
- package/dist/{chunk-RKJDBXTY.cjs.map → chunk-T4XWVPJK.cjs.map} +1 -1
- package/dist/{chunk-ZQNDSUZO.js → chunk-UKI64KUD.js} +6 -6
- package/dist/{chunk-SVW2UNUC.js → chunk-WON34HKM.js} +2 -2
- package/dist/chunk-YLB2WVNA.js +416 -0
- package/dist/chunk-YLB2WVNA.js.map +1 -0
- package/dist/chunk-ZOOEX3WT.cjs +604 -0
- package/dist/chunk-ZOOEX3WT.cjs.map +1 -0
- package/dist/extensions/index.cjs +6 -6
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +5 -5
- package/dist/image-editor/index.cjs +4387 -690
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +1677 -590
- package/dist/image-editor/index.d.ts +1677 -590
- package/dist/image-editor/index.js +4273 -576
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -10
- package/dist/paint/index.cjs +38 -0
- package/dist/paint/index.cjs.map +1 -0
- package/dist/paint/index.d.cts +167 -0
- package/dist/paint/index.d.ts +167 -0
- package/dist/paint/index.js +38 -0
- package/dist/paint/index.js.map +1 -0
- package/dist/raster/index.cjs +121 -0
- package/dist/raster/index.cjs.map +1 -0
- package/dist/raster/index.d.cts +365 -0
- package/dist/raster/index.d.ts +365 -0
- package/dist/raster/index.js +121 -0
- package/dist/raster/index.js.map +1 -0
- package/dist/serializers/index.cjs +4 -4
- package/dist/serializers/index.cjs.map +1 -1
- package/dist/serializers/index.js +3 -3
- package/dist/surface-fJhkmNQn.d.cts +181 -0
- package/dist/surface-fJhkmNQn.d.ts +181 -0
- package/dist/video-editor/index.cjs +930 -503
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +158 -11
- package/dist/video-editor/index.d.ts +158 -11
- package/dist/video-editor/index.js +841 -414
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +13 -2
- package/skills/pixerate-image-editor/SKILL.md +111 -11
- package/skills/pixerate-video-editor/SKILL.md +11 -2
- /package/dist/{chunk-IMSX4IVG.js.map → chunk-FWEO3HSL.js.map} +0 -0
- /package/dist/{chunk-GNO5PEMH.js.map → chunk-OK7T2LHK.js.map} +0 -0
- /package/dist/{chunk-ZQNDSUZO.js.map → chunk-UKI64KUD.js.map} +0 -0
- /package/dist/{chunk-SVW2UNUC.js.map → chunk-WON34HKM.js.map} +0 -0
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -168,20 +168,26 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
|
|
|
168
168
|
- `crates/ui-egui/src/palette.rs` (`fuzzy_score`, `exact_bonus`, `push_recent`) → `packages/core/src/commands/palette.ts`
|
|
169
169
|
- `crates/doc/src/adjust.rs` (`Adjustment` model, `HueRange::neutral` / `weight`, `LevelsChannel` defaults) → `packages/core/src/image-editor/types.ts`, `packages/core/src/image-editor/adjustment-layers.ts`
|
|
170
170
|
- `crates/compose/src/adjust.rs` (`curve_lut`, `levels_q`, `tone_luts_q`, `hue_saturation`, `range_lightness`, `hue_range_tables`, `rgb_to_hsl` / `hsl_to_rgb`, `vibrance_px` / `vibrance_lin`, `color_balance_channel`, `black_white_gray`, `photo_filter_matrix`, `posterize`, Threshold) → `packages/core/src/image-editor/adjustment-layers.ts`
|
|
171
|
-
- `crates/color/src/blend.rs` (separable and non-separable blend modes, hardened `clip_color`, `set_lum`, `composite`) → `packages/core/src/
|
|
171
|
+
- `crates/color/src/blend.rs` (separable and non-separable blend modes, hardened `clip_color`, `set_lum`, `composite`) → `packages/core/src/raster/blend.ts`
|
|
172
172
|
- `crates/color/src/convert.rs` (`D50`, `SRGB_TO_XYZ_D50`, `XYZ_D50_TO_SRGB`) → `packages/core/src/image-editor/adjustment-layers.ts`
|
|
173
173
|
- `crates/algo/src/histogram.rs` (bounded RGB histogram, transparent exclusion, exact-endpoint clipping) → `packages/core/src/image-editor/histogram.ts`
|
|
174
174
|
- Test cases from `crates/compose/src/adjust.rs`, `crates/compose/src/tests.rs`, `crates/doc/src/adjust.rs`, `crates/color/src/blend.rs` and `crates/algo/src/histogram.rs`, re-expressed → `packages/core/tests/image-editor-adjustment-layers.test.ts`, `packages/core/tests/image-editor-blend-histogram.test.ts`
|
|
175
175
|
- `crates/algo/src/selection.rs` (`SelectionMode` / `combine`, `magic_wand` / `wand_region` span fill and anti-aliasing, `color_range_samples`, `tone_range`, `hue_range`, `expand` / `contract` / `border`, anti-aliased `polygon`) → `packages/core/src/image-editor/selection/mask.ts`, `shapes.ts`, `wand.ts`, `modify.ts`
|
|
176
|
-
- `crates/algo/src/selection/distance.rs` (Felzenszwalb–Huttenlocher `edt`) and `crates/algo/src/selection_blur.rs` (Smooth: box + threshold; Feather: Gaussian with σ = radius) → `packages/core/src/image-editor/selection/modify.ts`
|
|
176
|
+
- `crates/algo/src/selection/distance.rs` (Felzenszwalb–Huttenlocher `edt`) and `crates/algo/src/selection_blur.rs` (Smooth: box + threshold; Feather: Gaussian with σ = radius) → `packages/core/src/image-editor/selection/modify.ts` and `packages/core/src/raster/blur.ts`
|
|
177
177
|
- `crates/algo/src/matting.rs` (`RefineParams`, `box_mean`, `guided_filter_color`, `edge_width`, `refine_buffer` band / smooth / feather / contrast / `shift_mask`) → `packages/core/src/image-editor/selection/refine.ts`, `modify.ts`
|
|
178
178
|
- `crates/paint/src/dynamics.rs` (`Smoother` pulled-string mode with `MAX_STRING_PX`, `string`, `finish` with catch-up on stroke end) → `LazyMouse` in `packages/core/src/vector/ink.ts`
|
|
179
|
+
- `crates/raster/src/lib.rs` (`Surface`: a sparse map of 256 px tiles behind shared pointers with a default pixel, copy-on-write writes that share untouched tiles, uniform tiles stored once, `prune` of tiles equal to the default, `content_bounds`, `translated`, region read / write) → `TiledSurface`, `SurfaceDraft`, `readRegion`, `writeRegion`, `fillRect`, `contentBounds` and `translateSurface` in `packages/core/src/raster/surface.ts`; 8-bit RGBA / 1-byte mask tiles instead of photocraft's pixel formats
|
|
180
|
+
- `crates/paint/src/lib.rs` (`TIP_SHAPE`, `tip_shape`, `soft_exp`, `tip_falloff`, `tip_reach`, `dab_coverage`: Photoshop's measured round tip; `smooth`), `crates/paint/src/dynamics.rs` (`PathWalker`: the first point as a dab, then one every spacing × diameter along the path; `base_diameter` and the Transfer pressure-to-opacity rule) and `crates/paint/src/render.rs` (`rasterize_into` for the round computed tip with a 4 × 4 sub-pixel grid below 3 px; `CoverageMap::accumulate`: flow building up towards each dab's opacity ceiling; `composite`: one composite at the stroke opacity over the pre-stroke pixels, the selection multiplying coverage, the eraser and lock transparency) → `packages/core/src/paint/brush.ts`; only the computed round tip, pressure size and opacity, and simple smoothing are ported (no sampled tips, jitter, texture, dual brush, wet edges or dithering); brush test cases re-expressed → `packages/core/tests/image-layers-paint.test.ts`
|
|
179
181
|
- `crates/engine/src/layer_mask_props_cmds.rs` and `crates/compose/src/masks.rs` (non-destructive mask density and feather) → `packages/core/src/image-editor/selection/layer-mask.ts`
|
|
180
182
|
- Test cases from `crates/algo/src/selection.rs`, `crates/algo/src/selection_blur.rs`, `crates/algo/src/matting.rs` and `crates/algo/src/tests_selection_mix.rs`, re-expressed → `packages/core/tests/image-editor-selection.test.ts`, `packages/core/tests/image-editor-selection-controller.test.ts`
|
|
181
183
|
- `crates/compose/src/gradient_fill.rs` (`midpoint_remap`; `Ramp`; `handles` / `from_handles`: the start and end points of the Linear, Radial, Angle, Reflected and Diamond styles) and `crates/compose/src/effects.rs` (`gradient_t`: Reflected as `|u|`, Diamond as `|along| + |across|`, Angle as a clockwise sweep from the gradient's direction) → `gradientMidpointRemap`, `vectorGradientParam` and the reflected / diamond / conic styles in `packages/core/src/vector/gradient.ts`; the styles share vectorcraft's start / end frame instead of an angle, scale and centre offset
|
|
182
184
|
- `crates/vector/src/map.rs` (`map_points`; `map_path`, `map_subpath`, `map_segment`, `split_mapped`, `halves`, `off_line`: segments halved until the mapped control points follow the mapped curve within a tolerance, straight segments whose image is straight kept as one, the split depth bounded on huge paths) → `mapVectorPoints`, `mapVectorSubpaths` and `mapBezierPath` in `packages/core/src/vector/pathMap.ts`; runs of pieces are then refitted with fewer cubics by our `fitCubicRun` where that stays within the tolerance, and smooth anchors have their handles made collinear again; test cases re-expressed → `packages/core/tests/vector-distort.test.ts`
|
|
183
185
|
- `crates/geom/src/warp.rs` (`WarpStyle` and its fifteen presets; `StyleWarp`; `rest_grid`, `edge_arc`, `arc_grid`, `blend_rows` and `preset_grid` with bend, horizontal and vertical distortion and the vertical orientation; `bernstein`, `split_cubic`, `BERN_INV`; `BezierMesh` — `identity`, `fit`, `eval`, `locate`, `split_u` / `split_v`, `remove_split_u` / `remove_split_v`, `transpose`, `map_points`, `param_at`, `pull`, `smooth_lines`, `drag_point`, `control_bounds`; `Warp::map`, `Warp::to_mesh`) → `packages/core/src/vector/warp.ts`, the `envelope` effect in `packages/core/src/vector/appearance.ts` and the Envelope tool in `packages/core/src/vector/controller.ts`; meshes are plain data (points in the node's space), the end patches extrapolate outside the box so handles past it map smoothly, and `vectorMeshFromOutline` (a Coons patch for Make with Top Object) is our own; Photoshop's measured cases were not copied — the presets are tested by their corner and edge behaviour → `packages/core/tests/vector-distort.test.ts`
|
|
184
186
|
- `crates/io/src/gradient_bake.rs` (`eval`: stop midpoints remapping each segment, Smoothness as a blend of linear interpolation and a Catmull-Rom spline through the stop colours with end tangents at half the chord slope, clamped to each segment; the Classic / Linear / Perceptual interpolation spaces as sRGB, linear light and Oklab; `bake`: the curve sampled into linear stops) → `vectorGradientRamp` and `expandVectorGradientStops` in `packages/core/src/vector/gradient.ts`; stops are placed adaptively to a tolerance instead of 96 even samples, and Photoshop's measured Smooth easing table was not ported; test cases re-expressed → `packages/core/tests/vector-gradient.test.ts`
|
|
187
|
+
- `crates/psd/src/io.rs` (the bounds-checked big-endian reader that never reads past its end, count checks before allocation, Pascal and Unicode strings, legacy names as UTF-8 else Latin-1), `crates/psd/src/descriptor.rs` (ActionDescriptor read / write: 4-character and long ids, every value type, the reference items, version 16, a nesting limit), `crates/psd/src/compression.rs` (PackBits encode / decode, RLE planes with u16 or (PSB) u32 row counts, ZIP and ZIP with prediction for 1, 8, 16 and 32 bits, the decoded-size limit), `crates/psd/src/header.rs`, `file.rs`, `layer.rs`, `tagged.rs`, `tree.rs`, `resources.rs` and `image_data.rs` (header limits, resources, layer records, channel lengths, the user mask with density / feather parameters and the real-before-parameters order Photoshop writes, tagged blocks with PSB long keys and padding detected from the next signature, `Lr16` / `Lr32` layers, `lsct` section dividers to a tree, `luni`, `lyid`, `iOpa`, `lspf`) → `packages/core/src/image-editor/psd/binary.ts`, `descriptor.ts`, `compression.ts` and `file.ts`; only what our layer model reads is kept (unknown blocks are not round-tripped byte for byte), and inflating uses our `raster/zlib.ts`
|
|
188
|
+
- `crates/io/src/adjust_map.rs` (`parse` / `write` for Levels, Curves including pencil maps, Hue/Saturation with `canonical_bounds`, Vibrance, Color Balance, Black & White with its tint descriptor, Photo Filter v2 and v3 XYZ, Invert, Posterize and Threshold; the adjustment key list and labels) and `crates/io/src/channel_map.rs` (`decode_known_color`: RGB, HSB, CMYK stored inverted, Lab, Grayscale) → `packages/core/src/image-editor/psd/adjust.ts`; parameters stay in our units, and a pencil curve becomes points every 15 levels
|
|
189
|
+
- `crates/io/src/psd_import.rs` (layer records to layers: missing colour channels as 0, missing alpha as opaque, a channel that is in the file but unreadable leaving the layer empty, the `-3` real mask when present, mask density / feather / disabled, groups from the dividers, warnings per problem) and `crates/io/src/pixels.rs` (planar samples at 1 / 8 / 16 / 32 bits to interleaved, CMYK inversion) → `packages/core/src/image-editor/psd/import.ts` and `pixels.ts`; colour modes other than RGB are converted with plain formulas (no CMYK profile), and 32-bit samples are encoded from linear light
|
|
190
|
+
- `crates/io/src/psd_export.rs` and `crates/psd/src/builder.rs` (layer records with RLE channels, group divider and folder records, adjustment blocks, user masks with parameters, `luni` / `lyid` / `iOpa` / `lspf`, the resolution and version-info resources, PSB above 30 000 px) → `packages/core/src/image-editor/psd/export.ts`; 8-bit RGB only, with the merged image from our compositor
|
|
185
191
|
|
|
186
192
|
## soundcraft
|
|
187
193
|
|
package/dist/agent/index.cjs
CHANGED
|
@@ -86,7 +86,7 @@ var _chunkRIWPYSKUcjs = require('../chunk-RIWPYSKU.cjs');
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
var
|
|
89
|
+
var _chunkT4XWVPJKcjs = require('../chunk-T4XWVPJK.cjs');
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
var _chunkTKPPIVW7cjs = require('../chunk-TKPPIVW7.cjs');
|
|
@@ -98,9 +98,9 @@ var _chunkCKRNELPOcjs = require('../chunk-CKRNELPO.cjs');
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
var
|
|
102
|
-
require('../chunk-IFHKKVXH.cjs');
|
|
101
|
+
var _chunk66IMF6ODcjs = require('../chunk-66IMF6OD.cjs');
|
|
103
102
|
require('../chunk-BVP3TSLH.cjs');
|
|
103
|
+
require('../chunk-IFHKKVXH.cjs');
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
@@ -493,7 +493,7 @@ function describe(chart, includeSpec) {
|
|
|
493
493
|
function sparklines(doc) {
|
|
494
494
|
const found = [];
|
|
495
495
|
doc.descendants((node, pos) => {
|
|
496
|
-
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label:
|
|
496
|
+
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkT4XWVPJKcjs.sparklineLabel.call(void 0, node) });
|
|
497
497
|
});
|
|
498
498
|
return found;
|
|
499
499
|
}
|
|
@@ -504,7 +504,7 @@ function checkPosition(editor, at) {
|
|
|
504
504
|
function createDocumentChartTools(editor) {
|
|
505
505
|
const chartType = () => editor().schema.nodes.chart;
|
|
506
506
|
const findChart = (args) => {
|
|
507
|
-
const charts =
|
|
507
|
+
const charts = _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, editor().state.doc);
|
|
508
508
|
const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
|
|
509
509
|
if (args.chartId !== void 0) {
|
|
510
510
|
const chart = charts.find((c) => c.id === args.chartId);
|
|
@@ -531,7 +531,7 @@ function createDocumentChartTools(editor) {
|
|
|
531
531
|
annotations: { title: "List charts in the document", ...READ },
|
|
532
532
|
handler: ({ includeSpec = false }) => {
|
|
533
533
|
const doc = editor().state.doc;
|
|
534
|
-
return { charts:
|
|
534
|
+
return { charts: _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
|
|
535
535
|
}
|
|
536
536
|
};
|
|
537
537
|
const insertChart = {
|
|
@@ -558,7 +558,7 @@ function createDocumentChartTools(editor) {
|
|
|
558
558
|
const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
|
|
559
559
|
const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
|
|
560
560
|
const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
|
|
561
|
-
const chart =
|
|
561
|
+
const chart = _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
|
|
562
562
|
if (!ok || !chart) throw new Error(`A chart cannot go at ${_nullishCoalesce(at, () => ( ed.state.selection.from))}; pass a position between blocks or inside a paragraph.`);
|
|
563
563
|
return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
|
|
564
564
|
}
|
|
@@ -605,8 +605,8 @@ function createDocumentChartTools(editor) {
|
|
|
605
605
|
inputSchema: {
|
|
606
606
|
type: "object",
|
|
607
607
|
properties: {
|
|
608
|
-
values: { type: "array", items: _chunkDK6QBGCScjs.VALUE, minItems: 1, maxItems:
|
|
609
|
-
kind: { type: "string", enum: [...
|
|
608
|
+
values: { type: "array", items: _chunkDK6QBGCScjs.VALUE, minItems: 1, maxItems: _chunkT4XWVPJKcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
|
|
609
|
+
kind: { type: "string", enum: [..._chunkT4XWVPJKcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
|
|
610
610
|
at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
|
|
611
611
|
width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
|
|
612
612
|
height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
|
|
@@ -625,7 +625,7 @@ function createDocumentChartTools(editor) {
|
|
|
625
625
|
if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
|
|
626
626
|
const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
|
|
627
627
|
if (!ed.state.doc.resolve(pos).parent.inlineContent) throw new Error(`Position ${pos} is between blocks; a sparkline goes inside a paragraph (use a position from get_text {blocks: true}).`);
|
|
628
|
-
const stored =
|
|
628
|
+
const stored = _chunkT4XWVPJKcjs.normalizeSparklineValues.call(void 0, parsed);
|
|
629
629
|
ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
|
|
630
630
|
return { pos, kind, values: stored };
|
|
631
631
|
}
|
|
@@ -660,8 +660,8 @@ function createTextPresence(editor, providerId, option) {
|
|
|
660
660
|
const config = option === false ? null : option === true || option === void 0 ? {} : option;
|
|
661
661
|
const caret = {
|
|
662
662
|
id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _23 => _23.id]), () => ( providerId)),
|
|
663
|
-
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _24 => _24.name]), () => (
|
|
664
|
-
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _25 => _25.color]), () => (
|
|
663
|
+
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _24 => _24.name]), () => ( _chunkT4XWVPJKcjs.DEFAULT_AGENT_CARET_NAME)),
|
|
664
|
+
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _25 => _25.color]), () => ( _chunkT4XWVPJKcjs.DEFAULT_AGENT_CARET_COLOR))
|
|
665
665
|
};
|
|
666
666
|
const typing = !_optionalChain([config, 'optionalAccess', _26 => _26.typing]) ? null : config.typing === true ? {} : config.typing;
|
|
667
667
|
const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _27 => _27.idleMs]), () => ( 12e3));
|
|
@@ -674,19 +674,19 @@ function createTextPresence(editor, providerId, option) {
|
|
|
674
674
|
};
|
|
675
675
|
const touch = () => {
|
|
676
676
|
clearTimeout(idleTimer);
|
|
677
|
-
if (idleMs > 0) idleTimer = setTimeout(() => live() &&
|
|
677
|
+
if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
|
|
678
678
|
};
|
|
679
679
|
const tint = (ed, ranges) => {
|
|
680
680
|
clearTimeout(tintTimer);
|
|
681
|
-
|
|
682
|
-
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() &&
|
|
681
|
+
_chunkT4XWVPJKcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
|
|
682
|
+
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
683
683
|
};
|
|
684
684
|
return {
|
|
685
685
|
/** Puts the caret at `head`, selecting from `anchor`. */
|
|
686
686
|
show(anchor, head = anchor) {
|
|
687
687
|
const ed = live();
|
|
688
688
|
if (!ed) return;
|
|
689
|
-
|
|
689
|
+
_chunkT4XWVPJKcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
|
|
690
690
|
touch();
|
|
691
691
|
},
|
|
692
692
|
/** Shows the caret after ranges just changed by a tool, tinting them. */
|
|
@@ -694,7 +694,7 @@ function createTextPresence(editor, providerId, option) {
|
|
|
694
694
|
const ed = live();
|
|
695
695
|
if (!ed || !ranges.length) return;
|
|
696
696
|
const last = ranges[ranges.length - 1];
|
|
697
|
-
|
|
697
|
+
_chunkT4XWVPJKcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
|
|
698
698
|
tint(ed, ranges);
|
|
699
699
|
touch();
|
|
700
700
|
},
|
|
@@ -702,12 +702,12 @@ function createTextPresence(editor, providerId, option) {
|
|
|
702
702
|
async write(ed, from, to, text, signal) {
|
|
703
703
|
if (live() && typing) {
|
|
704
704
|
clearTimeout(tintTimer);
|
|
705
|
-
const range2 = await
|
|
706
|
-
if (changedMs > 0) tintTimer = setTimeout(() => live() &&
|
|
705
|
+
const range2 = await _chunkT4XWVPJKcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
|
|
706
|
+
if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
707
707
|
touch();
|
|
708
708
|
return range2;
|
|
709
709
|
}
|
|
710
|
-
const tr =
|
|
710
|
+
const tr = _chunkT4XWVPJKcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text);
|
|
711
711
|
const end = tr.mapping.map(to, 1);
|
|
712
712
|
const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
|
|
713
713
|
ed.view.dispatch(tr.scrollIntoView());
|
|
@@ -736,7 +736,7 @@ function findMatches(editor, query, args, replacement) {
|
|
|
736
736
|
wholeWord: !!args.wholeWord,
|
|
737
737
|
...args.regex ? { regex: true } : { literal: true }
|
|
738
738
|
};
|
|
739
|
-
const result =
|
|
739
|
+
const result = _chunkT4XWVPJKcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
|
|
740
740
|
if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
|
|
741
741
|
return { matches: result.matches, truncated: result.truncated };
|
|
742
742
|
}
|
|
@@ -772,7 +772,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
772
772
|
},
|
|
773
773
|
handler: ({ format = "text", blocks = false }) => {
|
|
774
774
|
const ed = editor();
|
|
775
|
-
const content = format === "html" ? ed.getHTML() : format === "markdown" ?
|
|
775
|
+
const content = format === "html" ? ed.getHTML() : format === "markdown" ? _chunk66IMF6ODcjs.getEditorMarkdown.call(void 0, ed) : _chunk66IMF6ODcjs.getEditorText.call(void 0, ed);
|
|
776
776
|
return {
|
|
777
777
|
format,
|
|
778
778
|
content,
|
|
@@ -890,7 +890,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
890
890
|
replacement: String(replace).replace(/\r\n?|\n/g, "\r")
|
|
891
891
|
}));
|
|
892
892
|
const tr = ed.state.tr;
|
|
893
|
-
const ends =
|
|
893
|
+
const ends = _chunkT4XWVPJKcjs.applyReplacements.call(void 0, tr, chosen);
|
|
894
894
|
ed.view.dispatch(tr.scrollIntoView());
|
|
895
895
|
const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
|
|
896
896
|
presence.changed(ranges.filter((r) => r.from < r.to));
|
|
@@ -991,7 +991,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
991
991
|
inputSchema: {
|
|
992
992
|
type: "object",
|
|
993
993
|
properties: {
|
|
994
|
-
operation: { type: "string", enum:
|
|
994
|
+
operation: { type: "string", enum: _chunkT4XWVPJKcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
|
|
995
995
|
at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
|
|
996
996
|
rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
|
|
997
997
|
cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
|
|
@@ -1021,10 +1021,10 @@ function createRichTextToolProvider(target, options) {
|
|
|
1021
1021
|
ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
|
|
1022
1022
|
}
|
|
1023
1023
|
const action = operation;
|
|
1024
|
-
const state =
|
|
1024
|
+
const state = _chunkT4XWVPJKcjs.getTableActionState.call(void 0, ed, action, params);
|
|
1025
1025
|
if (state !== true) throw new Error(state);
|
|
1026
|
-
|
|
1027
|
-
const table =
|
|
1026
|
+
_chunkT4XWVPJKcjs.runTableAction.call(void 0, ed, action, params);
|
|
1027
|
+
const table = _chunkT4XWVPJKcjs.getTableState.call(void 0, ed);
|
|
1028
1028
|
return {
|
|
1029
1029
|
operation,
|
|
1030
1030
|
table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
|
|
@@ -1040,7 +1040,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1040
1040
|
if (!ed || ed.isDestroyed) return [];
|
|
1041
1041
|
if (!ed.isEditable) return [getText, findText, ...charts.read()];
|
|
1042
1042
|
const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection];
|
|
1043
|
-
return [...tools, ...
|
|
1043
|
+
return [...tools, ..._chunkT4XWVPJKcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write()];
|
|
1044
1044
|
},
|
|
1045
1045
|
subscribe: (notify) => {
|
|
1046
1046
|
const ed = editor();
|
package/dist/agent/index.js
CHANGED
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
setAgentCaret,
|
|
87
87
|
sparklineLabel,
|
|
88
88
|
typeAgentText
|
|
89
|
-
} from "../chunk-
|
|
89
|
+
} from "../chunk-OK7T2LHK.js";
|
|
90
90
|
import {
|
|
91
91
|
describeChart
|
|
92
92
|
} from "../chunk-ZOH6X3VR.js";
|
|
@@ -98,9 +98,9 @@ import {
|
|
|
98
98
|
import {
|
|
99
99
|
getEditorMarkdown,
|
|
100
100
|
getEditorText
|
|
101
|
-
} from "../chunk-
|
|
102
|
-
import "../chunk-SWE3NPOU.js";
|
|
101
|
+
} from "../chunk-UKI64KUD.js";
|
|
103
102
|
import "../chunk-O5RYH2PG.js";
|
|
103
|
+
import "../chunk-SWE3NPOU.js";
|
|
104
104
|
import {
|
|
105
105
|
isSingleCellRange,
|
|
106
106
|
normalizeRange,
|
package/dist/canvas/index.cjs
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunkK2UYKJ6Mcjs = require('../chunk-K2UYKJ6M.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
@@ -13,7 +12,6 @@ var _chunkK2UYKJ6Mcjs = require('../chunk-K2UYKJ6M.cjs');
|
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
var _chunkJEYDXRWQcjs = require('../chunk-JEYDXRWQ.cjs');
|
|
17
15
|
|
|
18
16
|
|
|
19
17
|
|
|
@@ -33,12 +31,14 @@ var _chunkJEYDXRWQcjs = require('../chunk-JEYDXRWQ.cjs');
|
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
|
|
34
|
+
var _chunkII77MLHNcjs = require('../chunk-II77MLHN.cjs');
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
|
|
41
|
+
var _chunkK2UYKJ6Mcjs = require('../chunk-K2UYKJ6M.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -47,7 +47,7 @@ var _chunkJEYDXRWQcjs = require('../chunk-JEYDXRWQ.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkJEYDXRWQcjs = require('../chunk-JEYDXRWQ.cjs');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|