@searsuite/sear-plugin-format-painter 0.0.0-stage → 0.0.1
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/LICENSE +29 -0
- package/README.md +8 -2
- package/dist/FormatPainterProtocol.d.ts +22 -0
- package/dist/FormatPainterProtocol.d.ts.map +1 -0
- package/dist/FormatPainterProtocol.js +12 -0
- package/dist/FormatPainterProtocol.js.map +1 -0
- package/dist/FormatPainterRange.d.ts +4 -0
- package/dist/FormatPainterRange.d.ts.map +1 -0
- package/dist/FormatPainterRange.js +17 -0
- package/dist/FormatPainterRange.js.map +1 -0
- package/dist/SheetFormatPainterOptions.d.ts +11 -0
- package/dist/SheetFormatPainterOptions.d.ts.map +1 -0
- package/dist/SheetFormatPainterOptions.js +3 -0
- package/dist/SheetFormatPainterOptions.js.map +1 -0
- package/dist/SheetFormatPainterSession.d.ts +13 -0
- package/dist/SheetFormatPainterSession.d.ts.map +1 -0
- package/dist/SheetFormatPainterSession.js +44 -0
- package/dist/SheetFormatPainterSession.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/sheetPlugin/formatPainter/SheetFormatPainterPlugin.d.ts +30 -0
- package/dist/sheetPlugin/formatPainter/SheetFormatPainterPlugin.d.ts.map +1 -0
- package/dist/sheetPlugin/formatPainter/SheetFormatPainterPlugin.js +140 -0
- package/dist/sheetPlugin/formatPainter/SheetFormatPainterPlugin.js.map +1 -0
- package/package.json +50 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LIZHAOTING (Eric)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
## Liability
|
|
24
|
+
|
|
25
|
+
To the maximum extent permitted by applicable law, in no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
|
|
26
|
+
|
|
27
|
+
## Warranty
|
|
28
|
+
|
|
29
|
+
This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @searsuite/sear-plugin-format-painter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copies Sheet formatting through state-owner contributions.
|
|
4
|
+
|
|
5
|
+
[API reference](https://searsuite.com/docs/ref/#sear-plugin-format-painter)
|
|
6
|
+
|
|
7
|
+
## Repository
|
|
8
|
+
|
|
9
|
+
Repository: [searsuite/packages/sear-plugin-format-painter](https://github.com/SearSuite/searsuite/tree/main/packages/sear-plugin-format-painter).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type SheetFormatRange } from '@searsuite/sear-assembly-plugin';
|
|
2
|
+
/** Canonical activation modes shared by commands and hosts. */
|
|
3
|
+
export declare const FormatPainterMode: {
|
|
4
|
+
readonly Once: "once";
|
|
5
|
+
readonly Persistent: "persistent";
|
|
6
|
+
};
|
|
7
|
+
export type FormatPainterMode = (typeof FormatPainterMode)[keyof typeof FormatPainterMode];
|
|
8
|
+
export interface FormatPainterState {
|
|
9
|
+
readonly mode: FormatPainterMode | null;
|
|
10
|
+
readonly source: SheetFormatRange | null;
|
|
11
|
+
}
|
|
12
|
+
export interface StartFormatPainterInput {
|
|
13
|
+
readonly source: SheetFormatRange;
|
|
14
|
+
readonly mode?: FormatPainterMode;
|
|
15
|
+
}
|
|
16
|
+
export declare const StartFormatPainterCommand: import("@searsuite/sear-assembly-commands").SheetCommandDefinition<StartFormatPainterInput, import("@searsuite/sear-assembly-commands").SheetCommandResult>;
|
|
17
|
+
export declare const ApplyFormatPainterCommand: import("@searsuite/sear-assembly-commands").SheetCommandDefinition<{
|
|
18
|
+
readonly destination: SheetFormatRange;
|
|
19
|
+
}, import("@searsuite/sear-assembly-commands").SheetCommandResult>;
|
|
20
|
+
export declare const CancelFormatPainterCommand: import("@searsuite/sear-assembly-commands").SheetCommandDefinition<void, import("@searsuite/sear-assembly-commands").SheetCommandResult>;
|
|
21
|
+
export declare const FormatPainterObservation: import("@searsuite/sear-foundation-subscription").StateObservationDefinition<FormatPainterState>;
|
|
22
|
+
//# sourceMappingURL=FormatPainterProtocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatPainterProtocol.d.ts","sourceRoot":"","sources":["../src/FormatPainterProtocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB;;;CAAsD,CAAC;AACrF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAC3F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC1C;AACD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;CACnC;AACD,eAAO,MAAM,yBAAyB,6JAA2E,CAAC;AAClH,eAAO,MAAM,yBAAyB;0BAA8C,gBAAgB;kEAEnG,CAAC;AACF,eAAO,MAAM,0BAA0B,0IAAmD,CAAC;AAC3F,eAAO,MAAM,wBAAwB,kGAAoE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormatPainterObservation = exports.CancelFormatPainterCommand = exports.ApplyFormatPainterCommand = exports.StartFormatPainterCommand = exports.FormatPainterMode = void 0;
|
|
4
|
+
const sear_assembly_commands_1 = require("@searsuite/sear-assembly-commands");
|
|
5
|
+
const sear_foundation_subscription_1 = require("@searsuite/sear-foundation-subscription");
|
|
6
|
+
/** Canonical activation modes shared by commands and hosts. */
|
|
7
|
+
exports.FormatPainterMode = { Once: 'once', Persistent: 'persistent' };
|
|
8
|
+
exports.StartFormatPainterCommand = (0, sear_assembly_commands_1.defineSheetCommand)('sheet.formatPainter.start');
|
|
9
|
+
exports.ApplyFormatPainterCommand = (0, sear_assembly_commands_1.defineSheetCommand)('sheet.formatPainter.apply');
|
|
10
|
+
exports.CancelFormatPainterCommand = (0, sear_assembly_commands_1.defineSheetCommand)('sheet.formatPainter.cancel');
|
|
11
|
+
exports.FormatPainterObservation = (0, sear_foundation_subscription_1.defineStateObservation)('sheet.formatPainter');
|
|
12
|
+
//# sourceMappingURL=FormatPainterProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatPainterProtocol.js","sourceRoot":"","sources":["../src/FormatPainterProtocol.ts"],"names":[],"mappings":";;;AAAA,8EAAuE;AAEvE,0FAAiF;AAEjF,+DAA+D;AAClD,QAAA,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAUxE,QAAA,yBAAyB,GAAG,IAAA,2CAAkB,EAA0B,2BAA2B,CAAC,CAAC;AACrG,QAAA,yBAAyB,GAAG,IAAA,2CAAkB,EACzD,2BAA2B,CAC5B,CAAC;AACW,QAAA,0BAA0B,GAAG,IAAA,2CAAkB,EAAC,4BAA4B,CAAC,CAAC;AAC9E,QAAA,wBAAwB,GAAG,IAAA,qDAAsB,EAAqB,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SheetFormatRange } from '@searsuite/sear-assembly-plugin';
|
|
2
|
+
/** Validates before capture/planning so invalid targets cannot partially mutate owners. */
|
|
3
|
+
export declare function normalizeFormatPainterRange(range: SheetFormatRange, shape: readonly [number, number]): SheetFormatRange;
|
|
4
|
+
//# sourceMappingURL=FormatPainterRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatPainterRange.d.ts","sourceRoot":"","sources":["../src/FormatPainterRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,2FAA2F;AAC3F,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,gBAAgB,CAUlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeFormatPainterRange = normalizeFormatPainterRange;
|
|
4
|
+
const sear_foundation_error_1 = require("@searsuite/sear-foundation-error");
|
|
5
|
+
/** Validates before capture/planning so invalid targets cannot partially mutate owners. */
|
|
6
|
+
function normalizeFormatPainterRange(range, shape) {
|
|
7
|
+
const points = [...range.start, ...range.end];
|
|
8
|
+
if (!points.every((point) => Number.isSafeInteger(point) && point >= 0)) {
|
|
9
|
+
throw new sear_foundation_error_1.SearError('Format painter requires nonnegative integer coordinates.', { range });
|
|
10
|
+
}
|
|
11
|
+
const start = [Math.min(range.start[0], range.end[0]), Math.min(range.start[1], range.end[1])];
|
|
12
|
+
const end = [Math.max(range.start[0], range.end[0]), Math.max(range.start[1], range.end[1])];
|
|
13
|
+
if (end[0] >= shape[0] || end[1] >= shape[1])
|
|
14
|
+
throw new sear_foundation_error_1.SearError('Format painter range exceeds sheet bounds.', { range, shape });
|
|
15
|
+
return Object.freeze({ start: Object.freeze(start), end: Object.freeze(end) });
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=FormatPainterRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatPainterRange.js","sourceRoot":"","sources":["../src/FormatPainterRange.ts"],"names":[],"mappings":";;AAIA,kEAaC;AAhBD,4EAA6D;AAE7D,2FAA2F;AAC3F,SAAgB,2BAA2B,CACzC,KAAuB,EACvB,KAAgC;IAEhC,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,iCAAS,CAAC,0DAA0D,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAU,CAAC;IACxG,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAU,CAAC;IACtG,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,IAAI,iCAAS,CAAC,4CAA4C,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SheetFormatTransferRegistry } from '@searsuite/sear-assembly-plugin';
|
|
2
|
+
import { type Platform } from '@searsuite/sear-foundation-platform';
|
|
3
|
+
import { type SheetFormatPainterSession } from './SheetFormatPainterSession';
|
|
4
|
+
/** Dependencies supplied by the owning composition root, with no global state. */
|
|
5
|
+
export interface SheetFormatPainterOptions {
|
|
6
|
+
readonly formats: SheetFormatTransferRegistry;
|
|
7
|
+
readonly readShape: () => readonly [number, number];
|
|
8
|
+
readonly platform: Platform;
|
|
9
|
+
readonly session?: SheetFormatPainterSession;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=SheetFormatPainterOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterOptions.d.ts","sourceRoot":"","sources":["../src/SheetFormatPainterOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,kFAAkF;AAClF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterOptions.js","sourceRoot":"","sources":["../src/SheetFormatPainterOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SheetFormatTransferRegistry, type SheetFormatTransferSnapshot } from '@searsuite/sear-assembly-plugin';
|
|
2
|
+
import { type FormatPainterState } from './FormatPainterProtocol';
|
|
3
|
+
/** Local brush state borrowed by Sheet editors mounted within one Workbook. */
|
|
4
|
+
export declare class SheetFormatPainterSession {
|
|
5
|
+
#private;
|
|
6
|
+
static readonly symbol: unique symbol;
|
|
7
|
+
get snapshot(): SheetFormatTransferSnapshot | null;
|
|
8
|
+
get state(): FormatPainterState;
|
|
9
|
+
visibleState(formats: SheetFormatTransferRegistry): FormatPainterState;
|
|
10
|
+
start(formats: SheetFormatTransferRegistry, snapshot: SheetFormatTransferSnapshot, state: FormatPainterState): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SheetFormatPainterSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterSession.d.ts","sourceRoot":"","sources":["../src/SheetFormatPainterSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACrH,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,+EAA+E;AAC/E,qBAAa,yBAAyB;;IACpC,gBAAuB,MAAM,gBAA2C;IAKxE,IAAW,QAAQ,IAAI,2BAA2B,GAAG,IAAI,CAA2B;IACpF,IAAW,KAAK,IAAI,kBAAkB,CAAwB;IAEvD,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,kBAAkB;IAMtE,KAAK,CACV,OAAO,EAAE,2BAA2B,EACpC,QAAQ,EAAE,2BAA2B,EACrC,KAAK,EAAE,kBAAkB,GACxB,IAAI;IAMA,KAAK,IAAI,IAAI;CAKrB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var _SheetFormatPainterSession_snapshot, _SheetFormatPainterSession_sourceFormats, _SheetFormatPainterSession_state;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SheetFormatPainterSession = void 0;
|
|
16
|
+
/** Local brush state borrowed by Sheet editors mounted within one Workbook. */
|
|
17
|
+
class SheetFormatPainterSession {
|
|
18
|
+
constructor() {
|
|
19
|
+
_SheetFormatPainterSession_snapshot.set(this, null);
|
|
20
|
+
_SheetFormatPainterSession_sourceFormats.set(this, null);
|
|
21
|
+
_SheetFormatPainterSession_state.set(this, Object.freeze({ mode: null, source: null }));
|
|
22
|
+
}
|
|
23
|
+
get snapshot() { return __classPrivateFieldGet(this, _SheetFormatPainterSession_snapshot, "f"); }
|
|
24
|
+
get state() { return __classPrivateFieldGet(this, _SheetFormatPainterSession_state, "f"); }
|
|
25
|
+
visibleState(formats) {
|
|
26
|
+
return __classPrivateFieldGet(this, _SheetFormatPainterSession_sourceFormats, "f") === formats
|
|
27
|
+
? __classPrivateFieldGet(this, _SheetFormatPainterSession_state, "f")
|
|
28
|
+
: { mode: __classPrivateFieldGet(this, _SheetFormatPainterSession_state, "f").mode, source: null };
|
|
29
|
+
}
|
|
30
|
+
start(formats, snapshot, state) {
|
|
31
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_sourceFormats, formats, "f");
|
|
32
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_snapshot, snapshot, "f");
|
|
33
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_state, state, "f");
|
|
34
|
+
}
|
|
35
|
+
clear() {
|
|
36
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_sourceFormats, null, "f");
|
|
37
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_snapshot, null, "f");
|
|
38
|
+
__classPrivateFieldSet(this, _SheetFormatPainterSession_state, Object.freeze({ mode: null, source: null }), "f");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.SheetFormatPainterSession = SheetFormatPainterSession;
|
|
42
|
+
_SheetFormatPainterSession_snapshot = new WeakMap(), _SheetFormatPainterSession_sourceFormats = new WeakMap(), _SheetFormatPainterSession_state = new WeakMap();
|
|
43
|
+
SheetFormatPainterSession.symbol = Symbol.for('SheetFormatPainterSession');
|
|
44
|
+
//# sourceMappingURL=SheetFormatPainterSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterSession.js","sourceRoot":"","sources":["../src/SheetFormatPainterSession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,+EAA+E;AAC/E,MAAa,yBAAyB;IAAtC;QAEE,8CAAgD,IAAI,EAAC;QACrD,mDAAqD,IAAI,EAAC;QAC1D,2CAA6B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAC;IA0B3E,CAAC;IAxBC,IAAW,QAAQ,KAAyC,OAAO,uBAAA,IAAI,2CAAU,CAAC,CAAC,CAAC;IACpF,IAAW,KAAK,KAAyB,OAAO,uBAAA,IAAI,wCAAO,CAAC,CAAC,CAAC;IAEvD,YAAY,CAAC,OAAoC;QACtD,OAAO,uBAAA,IAAI,gDAAe,KAAK,OAAO;YACpC,CAAC,CAAC,uBAAA,IAAI,wCAAO;YACb,CAAC,CAAC,EAAE,IAAI,EAAE,uBAAA,IAAI,wCAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAEM,KAAK,CACV,OAAoC,EACpC,QAAqC,EACrC,KAAyB;QAEzB,uBAAA,IAAI,4CAAkB,OAAO,MAAA,CAAC;QAC9B,uBAAA,IAAI,uCAAa,QAAQ,MAAA,CAAC;QAC1B,uBAAA,IAAI,oCAAU,KAAK,MAAA,CAAC;IACtB,CAAC;IAEM,KAAK;QACV,uBAAA,IAAI,4CAAkB,IAAI,MAAA,CAAC;QAC3B,uBAAA,IAAI,uCAAa,IAAI,MAAA,CAAC;QACtB,uBAAA,IAAI,oCAAU,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAA,CAAC;IAC5D,CAAC;;AA7BH,8DA8BC;;AA7BwB,gCAAM,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,AAA1C,CAA2C"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Sheet format painting through state-owner contributions. @packageDocumentation */
|
|
2
|
+
export { SheetFormatPainterPlugin } from './sheetPlugin/formatPainter/SheetFormatPainterPlugin';
|
|
3
|
+
export { SheetFormatPainterSession } from './SheetFormatPainterSession';
|
|
4
|
+
export { FormatPainterMode, StartFormatPainterCommand, ApplyFormatPainterCommand, CancelFormatPainterCommand, FormatPainterObservation, type FormatPainterState, type StartFormatPainterInput, } from './FormatPainterProtocol';
|
|
5
|
+
export { SheetFormatTransferRegistry, createMatrixFormatTransfer, type SheetFormatRange, type SheetFormatTransferContribution, type SheetFormatTransferSnapshot, type SheetFormatTransferPlan, } from '@searsuite/sear-assembly-plugin';
|
|
6
|
+
export { type SheetFormatPainterOptions } from './SheetFormatPainterOptions';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMatrixFormatTransfer = exports.SheetFormatTransferRegistry = exports.FormatPainterObservation = exports.CancelFormatPainterCommand = exports.ApplyFormatPainterCommand = exports.StartFormatPainterCommand = exports.FormatPainterMode = exports.SheetFormatPainterSession = exports.SheetFormatPainterPlugin = void 0;
|
|
4
|
+
/** Sheet format painting through state-owner contributions. @packageDocumentation */
|
|
5
|
+
var SheetFormatPainterPlugin_1 = require("./sheetPlugin/formatPainter/SheetFormatPainterPlugin");
|
|
6
|
+
Object.defineProperty(exports, "SheetFormatPainterPlugin", { enumerable: true, get: function () { return SheetFormatPainterPlugin_1.SheetFormatPainterPlugin; } });
|
|
7
|
+
var SheetFormatPainterSession_1 = require("./SheetFormatPainterSession");
|
|
8
|
+
Object.defineProperty(exports, "SheetFormatPainterSession", { enumerable: true, get: function () { return SheetFormatPainterSession_1.SheetFormatPainterSession; } });
|
|
9
|
+
var FormatPainterProtocol_1 = require("./FormatPainterProtocol");
|
|
10
|
+
Object.defineProperty(exports, "FormatPainterMode", { enumerable: true, get: function () { return FormatPainterProtocol_1.FormatPainterMode; } });
|
|
11
|
+
Object.defineProperty(exports, "StartFormatPainterCommand", { enumerable: true, get: function () { return FormatPainterProtocol_1.StartFormatPainterCommand; } });
|
|
12
|
+
Object.defineProperty(exports, "ApplyFormatPainterCommand", { enumerable: true, get: function () { return FormatPainterProtocol_1.ApplyFormatPainterCommand; } });
|
|
13
|
+
Object.defineProperty(exports, "CancelFormatPainterCommand", { enumerable: true, get: function () { return FormatPainterProtocol_1.CancelFormatPainterCommand; } });
|
|
14
|
+
Object.defineProperty(exports, "FormatPainterObservation", { enumerable: true, get: function () { return FormatPainterProtocol_1.FormatPainterObservation; } });
|
|
15
|
+
var sear_assembly_plugin_1 = require("@searsuite/sear-assembly-plugin");
|
|
16
|
+
Object.defineProperty(exports, "SheetFormatTransferRegistry", { enumerable: true, get: function () { return sear_assembly_plugin_1.SheetFormatTransferRegistry; } });
|
|
17
|
+
Object.defineProperty(exports, "createMatrixFormatTransfer", { enumerable: true, get: function () { return sear_assembly_plugin_1.createMatrixFormatTransfer; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qFAAqF;AACrF,iGAAgG;AAAvF,oIAAA,wBAAwB,OAAA;AACjC,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,iEAQiC;AAP/B,0HAAA,iBAAiB,OAAA;AACjB,kIAAA,yBAAyB,OAAA;AACzB,kIAAA,yBAAyB,OAAA;AACzB,mIAAA,0BAA0B,OAAA;AAC1B,iIAAA,wBAAwB,OAAA;AAI1B,wEAOyC;AANvC,mIAAA,2BAA2B,OAAA;AAC3B,kIAAA,0BAA0B,OAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type SheetFormatPainterOptions } from '../../SheetFormatPainterOptions';
|
|
2
|
+
import { type SheetCommandBus } from '@searsuite/sear-assembly-commands';
|
|
3
|
+
import { Plugin, PluginKey } from '@searsuite/sear-assembly-plugin';
|
|
4
|
+
import { type Transaction } from '@searsuite/sear-domain-transaction';
|
|
5
|
+
import { type ObservationRegistry } from '@searsuite/sear-foundation-subscription';
|
|
6
|
+
import { type CellProperties } from '@searsuite/sear-render-registry';
|
|
7
|
+
/** Owns only a local captured-format session; document formats remain with their owners. */
|
|
8
|
+
export declare class SheetFormatPainterPlugin extends Plugin<unknown, CellProperties, null> {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly options;
|
|
11
|
+
static readonly symbol: unique symbol;
|
|
12
|
+
readonly warnOnDuplicateDepth = false;
|
|
13
|
+
private readonly session;
|
|
14
|
+
private readonly listeners;
|
|
15
|
+
constructor(options: SheetFormatPainterOptions);
|
|
16
|
+
registerCommands(commands: SheetCommandBus): void;
|
|
17
|
+
registerObservations(observations: ObservationRegistry): void;
|
|
18
|
+
registerState(): {
|
|
19
|
+
key: PluginKey;
|
|
20
|
+
state: null;
|
|
21
|
+
dataEngine: {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
getPluginConfig(): null;
|
|
26
|
+
apply(_state: null, _transaction: Transaction): null;
|
|
27
|
+
render(): null;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=SheetFormatPainterPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterPlugin.d.ts","sourceRoot":"","sources":["../../../src/sheetPlugin/formatPainter/SheetFormatPainterPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAA8C,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAErH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGtE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAYtE,4FAA4F;AAC5F,qBACa,wBAAyB,SAAQ,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC;;IAO9D,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN3C,gBAAuB,MAAM,gBAA0C;IACvE,SAAyB,oBAAoB,SAAS;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IAEpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkD;gBAExC,OAAO,EAAE,yBAAyB;IAK/D,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAoDjD,oBAAoB,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI;IAY7D,aAAa;;;;;;;IAGb,eAAe,IAAI,IAAI;IAGvB,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,GAAG,IAAI;IAGpD,MAAM,IAAI,IAAI;IAGd,OAAO,IAAI,IAAI;CAsBvB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
17
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
18
|
+
};
|
|
19
|
+
var _SheetFormatPainterPlugin_instances, _SheetFormatPainterPlugin_commands, _SheetFormatPainterPlugin_clear, _SheetFormatPainterPlugin_publish;
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.SheetFormatPainterPlugin = void 0;
|
|
22
|
+
const sear_assembly_commands_1 = require("@searsuite/sear-assembly-commands");
|
|
23
|
+
const sear_assembly_core_1 = require("@searsuite/sear-assembly-core");
|
|
24
|
+
const sear_assembly_plugin_1 = require("@searsuite/sear-assembly-plugin");
|
|
25
|
+
const sear_foundation_di_1 = require("@searsuite/sear-foundation-di");
|
|
26
|
+
const sear_foundation_error_1 = require("@searsuite/sear-foundation-error");
|
|
27
|
+
const FormatPainterProtocol_1 = require("../../FormatPainterProtocol");
|
|
28
|
+
const FormatPainterRange_1 = require("../../FormatPainterRange");
|
|
29
|
+
const SheetFormatPainterSession_1 = require("../../SheetFormatPainterSession");
|
|
30
|
+
/** Owns only a local captured-format session; document formats remain with their owners. */
|
|
31
|
+
let SheetFormatPainterPlugin = class SheetFormatPainterPlugin extends sear_assembly_plugin_1.Plugin {
|
|
32
|
+
constructor(options) {
|
|
33
|
+
var _a;
|
|
34
|
+
super({ key: new sear_assembly_plugin_1.PluginKey('SheetFormatPainterPlugin'), state: null });
|
|
35
|
+
_SheetFormatPainterPlugin_instances.add(this);
|
|
36
|
+
this.options = options;
|
|
37
|
+
this.warnOnDuplicateDepth = false;
|
|
38
|
+
_SheetFormatPainterPlugin_commands.set(this, null);
|
|
39
|
+
this.listeners = new Set();
|
|
40
|
+
this.session = (_a = options.session) !== null && _a !== void 0 ? _a : new SheetFormatPainterSession_1.SheetFormatPainterSession();
|
|
41
|
+
}
|
|
42
|
+
registerCommands(commands) {
|
|
43
|
+
if (__classPrivateFieldGet(this, _SheetFormatPainterPlugin_commands, "f") && __classPrivateFieldGet(this, _SheetFormatPainterPlugin_commands, "f") !== commands) {
|
|
44
|
+
throw new sear_foundation_error_1.SearError('Sheet format painter commands are already bound to an editor.');
|
|
45
|
+
}
|
|
46
|
+
__classPrivateFieldSet(this, _SheetFormatPainterPlugin_commands, commands, "f");
|
|
47
|
+
commands.register(FormatPainterProtocol_1.StartFormatPainterCommand, (input) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const source = (0, FormatPainterRange_1.normalizeFormatPainterRange)(input.source, this.options.readShape());
|
|
50
|
+
const mode = (_a = input.mode) !== null && _a !== void 0 ? _a : FormatPainterProtocol_1.FormatPainterMode.Once;
|
|
51
|
+
if (!Object.values(FormatPainterProtocol_1.FormatPainterMode).includes(mode))
|
|
52
|
+
throw new sear_foundation_error_1.SearError('Invalid format painter mode.', { mode });
|
|
53
|
+
const snapshot = this.options.formats.capture(source);
|
|
54
|
+
return new sear_assembly_commands_1.LocalActionCommand(FormatPainterProtocol_1.StartFormatPainterCommand.id, () => {
|
|
55
|
+
this.session.start(this.options.formats, snapshot, Object.freeze({ mode, source }));
|
|
56
|
+
__classPrivateFieldGet(this, _SheetFormatPainterPlugin_instances, "m", _SheetFormatPainterPlugin_publish).call(this);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
commands.register(FormatPainterProtocol_1.CancelFormatPainterCommand, () => new sear_assembly_commands_1.LocalActionCommand(FormatPainterProtocol_1.CancelFormatPainterCommand.id, () => __classPrivateFieldGet(this, _SheetFormatPainterPlugin_instances, "m", _SheetFormatPainterPlugin_clear).call(this)));
|
|
60
|
+
commands.register(FormatPainterProtocol_1.ApplyFormatPainterCommand, (input) => {
|
|
61
|
+
const pipeline = new sear_assembly_core_1.Pipeline(FormatPainterProtocol_1.ApplyFormatPainterCommand.id);
|
|
62
|
+
if (this.session.snapshot && this.session.state.source) {
|
|
63
|
+
const shape = this.options.readShape();
|
|
64
|
+
let destination = (0, FormatPainterRange_1.normalizeFormatPainterRange)(input.destination, shape);
|
|
65
|
+
if (destination.start[0] === destination.end[0] && destination.start[1] === destination.end[1]) {
|
|
66
|
+
destination = (0, FormatPainterRange_1.normalizeFormatPainterRange)({
|
|
67
|
+
start: destination.start,
|
|
68
|
+
end: [
|
|
69
|
+
Math.min(shape[0] - 1, destination.start[0] + this.session.state.source.end[0] - this.session.state.source.start[0]),
|
|
70
|
+
Math.min(shape[1] - 1, destination.start[1] + this.session.state.source.end[1] - this.session.state.source.start[1]),
|
|
71
|
+
],
|
|
72
|
+
}, shape);
|
|
73
|
+
}
|
|
74
|
+
const captured = this.session.snapshot;
|
|
75
|
+
captured.plan(destination, this.options.formats).forEach((plan) => {
|
|
76
|
+
if (plan.operations.length)
|
|
77
|
+
pipeline.addTransaction('formatPainter.applyOwner', (0, sear_assembly_commands_1.createSheetTransaction)(plan.target, [...plan.operations]));
|
|
78
|
+
});
|
|
79
|
+
// Complete the local session only after Core has committed and rendered the pipeline.
|
|
80
|
+
if (this.session.state.mode === FormatPainterProtocol_1.FormatPainterMode.Once)
|
|
81
|
+
pipeline.use({ onComplete: () => __classPrivateFieldGet(this, _SheetFormatPainterPlugin_instances, "m", _SheetFormatPainterPlugin_clear).call(this) });
|
|
82
|
+
}
|
|
83
|
+
return { id: FormatPainterProtocol_1.ApplyFormatPainterCommand.id, execute: () => ({ pipeline }) };
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
registerObservations(observations) {
|
|
87
|
+
observations.register(FormatPainterProtocol_1.FormatPainterObservation, {
|
|
88
|
+
getSnapshot: () => this.session.visibleState(this.options.formats),
|
|
89
|
+
subscribe: (listener) => {
|
|
90
|
+
this.listeners.add(listener);
|
|
91
|
+
return () => {
|
|
92
|
+
this.listeners.delete(listener);
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
registerState() {
|
|
98
|
+
return { key: this.key, state: null, dataEngine: { enabled: false } };
|
|
99
|
+
}
|
|
100
|
+
getPluginConfig() {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
apply(_state, _transaction) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
destroy() {
|
|
110
|
+
this.assertRuntimeWriteAllowed();
|
|
111
|
+
if (!this.options.session)
|
|
112
|
+
this.session.clear();
|
|
113
|
+
this.listeners.clear();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.SheetFormatPainterPlugin = SheetFormatPainterPlugin;
|
|
117
|
+
_SheetFormatPainterPlugin_commands = new WeakMap();
|
|
118
|
+
_SheetFormatPainterPlugin_instances = new WeakSet();
|
|
119
|
+
_SheetFormatPainterPlugin_clear = function _SheetFormatPainterPlugin_clear() {
|
|
120
|
+
this.session.clear();
|
|
121
|
+
__classPrivateFieldGet(this, _SheetFormatPainterPlugin_instances, "m", _SheetFormatPainterPlugin_publish).call(this);
|
|
122
|
+
};
|
|
123
|
+
_SheetFormatPainterPlugin_publish = function _SheetFormatPainterPlugin_publish() {
|
|
124
|
+
const state = this.session.visibleState(this.options.formats);
|
|
125
|
+
(0, sear_assembly_core_1.runOutsideCommandExecution)(() => {
|
|
126
|
+
[...this.listeners].forEach((listener) => {
|
|
127
|
+
try {
|
|
128
|
+
listener(state);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
this.options.platform.warn('Format painter listener failed.', error);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
SheetFormatPainterPlugin.symbol = Symbol.for('SheetFormatPainterPlugin');
|
|
137
|
+
exports.SheetFormatPainterPlugin = SheetFormatPainterPlugin = __decorate([
|
|
138
|
+
(0, sear_foundation_di_1.Injectable)()
|
|
139
|
+
], SheetFormatPainterPlugin);
|
|
140
|
+
//# sourceMappingURL=SheetFormatPainterPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetFormatPainterPlugin.js","sourceRoot":"","sources":["../../../src/sheetPlugin/formatPainter/SheetFormatPainterPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8EAAqH;AACrH,sEAAqF;AACrF,0EAAoE;AAEpE,sEAA2D;AAC3D,4EAA6D;AAG7D,uEAOqC;AACrC,iEAAuE;AACvE,+EAA4E;AAE5E,4FAA4F;AAErF,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,6BAAqC;IAOjF,YAAoC,OAAkC;;QACpE,KAAK,CAAC,EAAE,GAAG,EAAE,IAAI,gCAAS,CAAC,0BAA0B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;;QADrC,YAAO,GAAP,OAAO,CAA2B;QAL7C,yBAAoB,GAAG,KAAK,CAAC;QAEtD,6CAAoC,IAAI,EAAC;QACxB,cAAS,GAAG,IAAI,GAAG,EAAuC,CAAC;QAI1E,IAAI,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAI,qDAAyB,EAAE,CAAC;IACpE,CAAC;IAEM,gBAAgB,CAAC,QAAyB;QAC/C,IAAI,uBAAA,IAAI,0CAAU,IAAI,uBAAA,IAAI,0CAAU,KAAK,QAAQ,EAAE,CAAC;YAClD,MAAM,IAAI,iCAAS,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C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searsuite/sear-plugin-format-painter",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Copies Sheet formatting through state-owner contributions.",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://searsuite.com/",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"searsuite",
|
|
9
|
+
"spreadsheet",
|
|
10
|
+
"format-painter",
|
|
11
|
+
"plugin"
|
|
12
|
+
],
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@searsuite/sear-assembly-plugin": "0.0.1",
|
|
20
|
+
"@searsuite/sear-assembly-core": "0.0.1",
|
|
21
|
+
"@searsuite/sear-domain-transaction": "0.0.1",
|
|
22
|
+
"@searsuite/sear-foundation-error": "0.0.1",
|
|
23
|
+
"@searsuite/sear-foundation-platform": "0.0.1",
|
|
24
|
+
"@searsuite/sear-foundation-di": "0.0.1",
|
|
25
|
+
"@searsuite/sear-foundation-subscription": "0.0.1",
|
|
26
|
+
"@searsuite/sear-assembly-commands": "0.0.1",
|
|
27
|
+
"@searsuite/sear-render-node": "0.0.1",
|
|
28
|
+
"@searsuite/sear-render-registry": "0.0.1"
|
|
29
|
+
},
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/SearSuite/searsuite.git",
|
|
40
|
+
"directory": "packages/sear-plugin-format-painter"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/SearSuite/searsuite/issues"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "pnpm run clean && pnpm run compile",
|
|
50
|
+
"clean": "rimraf ./dist",
|
|
51
|
+
"compile": "tsc -p tsconfig.build.json"
|
|
52
|
+
}
|
|
6
53
|
}
|