@pixerate/editor 0.26.1 → 0.28.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/README.md +32 -3
- package/dist/agent/index.cjs +56 -6
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +6 -4
- package/dist/agent/index.d.ts +6 -4
- package/dist/agent/index.js +51 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +62 -0
- package/dist/animation/index.cjs.map +1 -0
- package/dist/animation/index.d.cts +296 -0
- package/dist/animation/index.d.ts +296 -0
- package/dist/animation/index.js +62 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/{builtins-Chj6zv_O.d.ts → builtins-haN82vjT.d.ts} +33 -3
- package/dist/{builtins-CdPcLwwF.d.cts → builtins-nMXh9sT3.d.cts} +33 -3
- package/dist/canvas/index.cjs +535 -737
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +74 -291
- package/dist/canvas/index.d.ts +74 -291
- package/dist/canvas/index.js +417 -619
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-X7HXL2SB.js → chunk-3RPOW4CS.js} +342 -16
- package/dist/chunk-3RPOW4CS.js.map +1 -0
- package/dist/{chunk-UBCFIABU.js → chunk-5H2OPMXZ.js} +183 -6
- package/dist/chunk-5H2OPMXZ.js.map +1 -0
- package/dist/chunk-A6PHCAGX.cjs +87 -0
- package/dist/chunk-A6PHCAGX.cjs.map +1 -0
- package/dist/{chunk-HRMEDT2L.js → chunk-D6AVOTSD.js} +6 -85
- package/dist/chunk-D6AVOTSD.js.map +1 -0
- package/dist/chunk-HXDMZQTD.cjs +497 -0
- package/dist/chunk-HXDMZQTD.cjs.map +1 -0
- package/dist/chunk-IB3ZHQAX.js +497 -0
- package/dist/chunk-IB3ZHQAX.js.map +1 -0
- package/dist/{chunk-4BVP64JJ.cjs → chunk-K2UYKJ6M.cjs} +24 -103
- package/dist/chunk-K2UYKJ6M.cjs.map +1 -0
- package/dist/{chunk-HDYMLS3X.cjs → chunk-MC2LQN5S.cjs} +196 -19
- package/dist/chunk-MC2LQN5S.cjs.map +1 -0
- package/dist/{chunk-XQFHLT53.js → chunk-MXZJ4PKN.js} +24 -10
- package/dist/chunk-MXZJ4PKN.js.map +1 -0
- package/dist/{chunk-LN2POBHT.cjs → chunk-OYEFRO3D.cjs} +28 -14
- package/dist/chunk-OYEFRO3D.cjs.map +1 -0
- package/dist/chunk-PWJARCI4.js +637 -0
- package/dist/chunk-PWJARCI4.js.map +1 -0
- package/dist/chunk-TGD52FEZ.js +87 -0
- package/dist/chunk-TGD52FEZ.js.map +1 -0
- package/dist/chunk-TTYCN6ZH.cjs +637 -0
- package/dist/chunk-TTYCN6ZH.cjs.map +1 -0
- package/dist/{chunk-NQF32I6Z.cjs → chunk-U7VGDSNY.cjs} +463 -137
- package/dist/chunk-U7VGDSNY.cjs.map +1 -0
- package/dist/commands/index.cjs +30 -410
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +17 -397
- package/dist/commands/index.js.map +1 -1
- package/dist/{controller-CxXGOEmy.d.ts → controller-w6eRTjF8.d.cts} +67 -2
- package/dist/{controller-CxXGOEmy.d.cts → controller-w6eRTjF8.d.ts} +67 -2
- package/dist/extensions/index.cjs +25 -7
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +32 -14
- package/dist/generation/index.cjs +3 -3
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +3 -3
- package/dist/{index-jcJwmBYt.d.cts → index-C6gaQRH0.d.cts} +53 -4
- package/dist/{index-B273Zllk.d.ts → index-DXAv_R08.d.ts} +53 -4
- package/dist/index.cjs +57 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +132 -94
- package/dist/index.js.map +1 -1
- package/dist/spreadsheet/index.cjs +23 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +76 -3
- package/dist/spreadsheet/index.d.ts +76 -3
- package/dist/spreadsheet/index.js +28 -8
- package/dist/tokens/index.cjs +4 -2
- package/dist/tokens/index.cjs.map +1 -1
- package/dist/tokens/index.js +6 -4
- package/package.json +6 -1
- package/dist/chunk-4BVP64JJ.cjs.map +0 -1
- package/dist/chunk-HDYMLS3X.cjs.map +0 -1
- package/dist/chunk-HRMEDT2L.js.map +0 -1
- package/dist/chunk-LN2POBHT.cjs.map +0 -1
- package/dist/chunk-NQF32I6Z.cjs.map +0 -1
- package/dist/chunk-UBCFIABU.js.map +0 -1
- package/dist/chunk-X7HXL2SB.js.map +0 -1
- package/dist/chunk-XQFHLT53.js.map +0 -1
|
@@ -131,7 +131,34 @@ interface ComponentCommandTarget {
|
|
|
131
131
|
canGoToMainComponent(id?: string): true | string;
|
|
132
132
|
list(): unknown;
|
|
133
133
|
inspect(id?: string): unknown;
|
|
134
|
+
addVariant?(setId?: string, options?: {
|
|
135
|
+
from?: string;
|
|
136
|
+
variant?: Record<string, string>;
|
|
137
|
+
position?: {
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
};
|
|
141
|
+
defaultValue?: string;
|
|
142
|
+
}): ComponentActionResult;
|
|
143
|
+
canAddVariant?(setId?: string, options?: {
|
|
144
|
+
from?: string;
|
|
145
|
+
variant?: Record<string, string>;
|
|
146
|
+
}): true | string;
|
|
147
|
+
removeVariant?(variantId?: string): ComponentActionResult;
|
|
148
|
+
canRemoveVariant?(variantId?: string): true | string;
|
|
149
|
+
setVariantProperties?(values: Record<string, string>, variantId?: string, options?: {
|
|
150
|
+
defaultValue?: string;
|
|
151
|
+
}): ComponentActionResult;
|
|
152
|
+
canSetVariantProperties?(values?: Record<string, string>, variantId?: string): true | string;
|
|
153
|
+
renameVariantProperty?(name: string, newName: string, setId?: string): ComponentActionResult;
|
|
154
|
+
canRenameVariantProperty?(name?: string, newName?: string, setId?: string): true | string;
|
|
155
|
+
renameVariantValue?(property: string, value: string, newValue: string, setId?: string): ComponentActionResult;
|
|
156
|
+
canRenameVariantValue?(property?: string, value?: string, newValue?: string, setId?: string): true | string;
|
|
134
157
|
}
|
|
158
|
+
/** The variant-editing part of a `ComponentCommandTarget` (present on the components controller). */
|
|
159
|
+
type VariantCommandTarget = Required<Pick<ComponentCommandTarget, 'addVariant' | 'canAddVariant' | 'removeVariant' | 'canRemoveVariant' | 'setVariantProperties' | 'canSetVariantProperties' | 'renameVariantProperty' | 'canRenameVariantProperty' | 'renameVariantValue' | 'canRenameVariantValue'>>;
|
|
160
|
+
/** Whether a command target can edit variants. */
|
|
161
|
+
declare function hasVariantCommands(controller: ComponentCommandTarget): controller is ComponentCommandTarget & VariantCommandTarget;
|
|
135
162
|
interface ComponentCommandOptions {
|
|
136
163
|
/** Id prefix (default `canvas.`). */
|
|
137
164
|
prefix?: string;
|
|
@@ -145,8 +172,11 @@ interface ComponentCommandOptions {
|
|
|
145
172
|
* (`{ componentId, parentId?, x?, y?, properties? }`), `canvas.detachInstance`,
|
|
146
173
|
* `canvas.resetOverrides` (`{ id?, group? }`), `canvas.pushOverrides`, `canvas.goToMainComponent`,
|
|
147
174
|
* `canvas.swapInstance` (`{ componentId, ids? }`), `canvas.setInstanceProperties`
|
|
148
|
-
* (`{ properties, ids? }`: variant and component property values), `canvas.restoreMainComponent
|
|
149
|
-
*
|
|
175
|
+
* (`{ properties, ids? }`: variant and component property values), `canvas.restoreMainComponent`,
|
|
176
|
+
* the variant editors `canvas.addVariant` (`{ setId?, from?, variant?, x?, y? }`),
|
|
177
|
+
* `canvas.removeVariant` (`{ id? }`), `canvas.setVariantProperties` (`{ values, id? }`),
|
|
178
|
+
* `canvas.renameVariantProperty` (`{ name, newName, setId? }`) and `canvas.renameVariantValue`
|
|
179
|
+
* (`{ property, value, newValue, setId? }`) when the target has them, and the read-only `canvas.listComponents` / `canvas.inspectInstance`. Each action is one
|
|
150
180
|
* undoable step when the controller has a history; enablement explains why it cannot run.
|
|
151
181
|
*/
|
|
152
182
|
declare function createComponentCommands(controller: ComponentCommandTarget, options?: ComponentCommandOptions): CommandSpec[];
|
|
@@ -173,4 +203,4 @@ interface SpreadsheetCommandOptions {
|
|
|
173
203
|
/** Palette / agent commands for common spreadsheet table actions (no default shortcuts). */
|
|
174
204
|
declare function createSpreadsheetCommands(controller: SpreadsheetCommandTarget, options?: SpreadsheetCommandOptions): CommandSpec[];
|
|
175
205
|
|
|
176
|
-
export { type ArrangeCommandOptions as A, type ComponentCommandOptions as C, DEFAULT_HISTORY_SHORTCUTS as D, type HistoryCommandOptions as H, type ShapeCommandOptions as S, type ArrangeCommandTarget as a, type ComponentCommandTarget as b, type HistoryCommandTarget as c, type ShapeCommandTarget as d, type SpreadsheetCommandOptions as e, type SpreadsheetCommandTarget as f, createArrangeCommands as g, createComponentCommands as h, createHistoryCommands as i, createShapeCommands as j, createSpreadsheetCommands as k, matchHistoryShortcut as m };
|
|
206
|
+
export { type ArrangeCommandOptions as A, type ComponentCommandOptions as C, DEFAULT_HISTORY_SHORTCUTS as D, type HistoryCommandOptions as H, type ShapeCommandOptions as S, type ArrangeCommandTarget as a, type ComponentCommandTarget as b, type HistoryCommandTarget as c, type ShapeCommandTarget as d, type SpreadsheetCommandOptions as e, type SpreadsheetCommandTarget as f, createArrangeCommands as g, createComponentCommands as h, createHistoryCommands as i, createShapeCommands as j, createSpreadsheetCommands as k, hasVariantCommands as l, matchHistoryShortcut as m };
|
|
@@ -131,7 +131,34 @@ interface ComponentCommandTarget {
|
|
|
131
131
|
canGoToMainComponent(id?: string): true | string;
|
|
132
132
|
list(): unknown;
|
|
133
133
|
inspect(id?: string): unknown;
|
|
134
|
+
addVariant?(setId?: string, options?: {
|
|
135
|
+
from?: string;
|
|
136
|
+
variant?: Record<string, string>;
|
|
137
|
+
position?: {
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
};
|
|
141
|
+
defaultValue?: string;
|
|
142
|
+
}): ComponentActionResult;
|
|
143
|
+
canAddVariant?(setId?: string, options?: {
|
|
144
|
+
from?: string;
|
|
145
|
+
variant?: Record<string, string>;
|
|
146
|
+
}): true | string;
|
|
147
|
+
removeVariant?(variantId?: string): ComponentActionResult;
|
|
148
|
+
canRemoveVariant?(variantId?: string): true | string;
|
|
149
|
+
setVariantProperties?(values: Record<string, string>, variantId?: string, options?: {
|
|
150
|
+
defaultValue?: string;
|
|
151
|
+
}): ComponentActionResult;
|
|
152
|
+
canSetVariantProperties?(values?: Record<string, string>, variantId?: string): true | string;
|
|
153
|
+
renameVariantProperty?(name: string, newName: string, setId?: string): ComponentActionResult;
|
|
154
|
+
canRenameVariantProperty?(name?: string, newName?: string, setId?: string): true | string;
|
|
155
|
+
renameVariantValue?(property: string, value: string, newValue: string, setId?: string): ComponentActionResult;
|
|
156
|
+
canRenameVariantValue?(property?: string, value?: string, newValue?: string, setId?: string): true | string;
|
|
134
157
|
}
|
|
158
|
+
/** The variant-editing part of a `ComponentCommandTarget` (present on the components controller). */
|
|
159
|
+
type VariantCommandTarget = Required<Pick<ComponentCommandTarget, 'addVariant' | 'canAddVariant' | 'removeVariant' | 'canRemoveVariant' | 'setVariantProperties' | 'canSetVariantProperties' | 'renameVariantProperty' | 'canRenameVariantProperty' | 'renameVariantValue' | 'canRenameVariantValue'>>;
|
|
160
|
+
/** Whether a command target can edit variants. */
|
|
161
|
+
declare function hasVariantCommands(controller: ComponentCommandTarget): controller is ComponentCommandTarget & VariantCommandTarget;
|
|
135
162
|
interface ComponentCommandOptions {
|
|
136
163
|
/** Id prefix (default `canvas.`). */
|
|
137
164
|
prefix?: string;
|
|
@@ -145,8 +172,11 @@ interface ComponentCommandOptions {
|
|
|
145
172
|
* (`{ componentId, parentId?, x?, y?, properties? }`), `canvas.detachInstance`,
|
|
146
173
|
* `canvas.resetOverrides` (`{ id?, group? }`), `canvas.pushOverrides`, `canvas.goToMainComponent`,
|
|
147
174
|
* `canvas.swapInstance` (`{ componentId, ids? }`), `canvas.setInstanceProperties`
|
|
148
|
-
* (`{ properties, ids? }`: variant and component property values), `canvas.restoreMainComponent
|
|
149
|
-
*
|
|
175
|
+
* (`{ properties, ids? }`: variant and component property values), `canvas.restoreMainComponent`,
|
|
176
|
+
* the variant editors `canvas.addVariant` (`{ setId?, from?, variant?, x?, y? }`),
|
|
177
|
+
* `canvas.removeVariant` (`{ id? }`), `canvas.setVariantProperties` (`{ values, id? }`),
|
|
178
|
+
* `canvas.renameVariantProperty` (`{ name, newName, setId? }`) and `canvas.renameVariantValue`
|
|
179
|
+
* (`{ property, value, newValue, setId? }`) when the target has them, and the read-only `canvas.listComponents` / `canvas.inspectInstance`. Each action is one
|
|
150
180
|
* undoable step when the controller has a history; enablement explains why it cannot run.
|
|
151
181
|
*/
|
|
152
182
|
declare function createComponentCommands(controller: ComponentCommandTarget, options?: ComponentCommandOptions): CommandSpec[];
|
|
@@ -173,4 +203,4 @@ interface SpreadsheetCommandOptions {
|
|
|
173
203
|
/** Palette / agent commands for common spreadsheet table actions (no default shortcuts). */
|
|
174
204
|
declare function createSpreadsheetCommands(controller: SpreadsheetCommandTarget, options?: SpreadsheetCommandOptions): CommandSpec[];
|
|
175
205
|
|
|
176
|
-
export { type ArrangeCommandOptions as A, type ComponentCommandOptions as C, DEFAULT_HISTORY_SHORTCUTS as D, type HistoryCommandOptions as H, type ShapeCommandOptions as S, type ArrangeCommandTarget as a, type ComponentCommandTarget as b, type HistoryCommandTarget as c, type ShapeCommandTarget as d, type SpreadsheetCommandOptions as e, type SpreadsheetCommandTarget as f, createArrangeCommands as g, createComponentCommands as h, createHistoryCommands as i, createShapeCommands as j, createSpreadsheetCommands as k, matchHistoryShortcut as m };
|
|
206
|
+
export { type ArrangeCommandOptions as A, type ComponentCommandOptions as C, DEFAULT_HISTORY_SHORTCUTS as D, type HistoryCommandOptions as H, type ShapeCommandOptions as S, type ArrangeCommandTarget as a, type ComponentCommandTarget as b, type HistoryCommandTarget as c, type ShapeCommandTarget as d, type SpreadsheetCommandOptions as e, type SpreadsheetCommandTarget as f, createArrangeCommands as g, createComponentCommands as h, createHistoryCommands as i, createShapeCommands as j, createSpreadsheetCommands as k, hasVariantCommands as l, matchHistoryShortcut as m };
|