@pixerate/editor 0.152.0 → 0.153.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.
Files changed (41) hide show
  1. package/dist/animation-editor/index.cjs +4 -4
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/canvas/index.cjs +16 -13
  4. package/dist/canvas/index.js +4 -1
  5. package/dist/chart/index.cjs +3 -3
  6. package/dist/chart/index.js +3 -3
  7. package/dist/{chunk-VGJTUCWM.js → chunk-4J4MC3F5.js} +72 -5
  8. package/dist/{chunk-LFKLA7RC.js → chunk-BCY22GBH.js} +39 -1
  9. package/dist/{chunk-2ZO4RSDS.cjs → chunk-HVX35M2I.cjs} +39 -1
  10. package/dist/{chunk-QSM3MDDJ.cjs → chunk-XFDQEAOS.cjs} +92 -25
  11. package/dist/image-editor/index.cjs +3 -3
  12. package/dist/image-editor/index.js +3 -3
  13. package/dist/index.cjs +41 -2
  14. package/dist/index.d.cts +1 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.js +40 -1
  17. package/dist/richTextDocument.d.cts +10 -0
  18. package/dist/richTextDocument.d.ts +10 -0
  19. package/dist/spreadsheet/controller.d.cts +17 -4
  20. package/dist/spreadsheet/controller.d.ts +17 -4
  21. package/dist/spreadsheet/editorDocument.d.cts +9 -0
  22. package/dist/spreadsheet/editorDocument.d.ts +9 -0
  23. package/dist/spreadsheet/index.cjs +7 -2
  24. package/dist/spreadsheet/index.d.cts +1 -0
  25. package/dist/spreadsheet/index.d.ts +1 -0
  26. package/dist/spreadsheet/index.js +6 -1
  27. package/dist/tokens/editorDocument.d.cts +10 -0
  28. package/dist/tokens/editorDocument.d.ts +10 -0
  29. package/dist/tokens/index.cjs +7 -2
  30. package/dist/tokens/index.d.cts +1 -0
  31. package/dist/tokens/index.d.ts +1 -0
  32. package/dist/tokens/index.js +6 -1
  33. package/dist/vector/index.cjs +4 -4
  34. package/dist/vector/index.js +4 -4
  35. package/dist/video-editor/index.cjs +4 -4
  36. package/dist/video-editor/index.js +4 -4
  37. package/package.json +1 -1
  38. package/skills/README.md +1 -0
  39. package/skills/pixerate-rich-text/SKILL.md +14 -0
  40. package/skills/pixerate-spreadsheet/SKILL.md +14 -0
  41. package/skills/pixerate-tokens/SKILL.md +56 -0
@@ -125,6 +125,7 @@ export declare class SpreadsheetController {
125
125
  private boundSheetId;
126
126
  private names;
127
127
  private onSelectionChange?;
128
+ private readonly changeListeners;
128
129
  private onCellCommit?;
129
130
  private undoStack;
130
131
  private redoStack;
@@ -196,8 +197,13 @@ export declare class SpreadsheetController {
196
197
  * sheet's `names`).
197
198
  */
198
199
  getWorkbook(): SpreadsheetWorkbook;
199
- /** Replaces the whole workbook (sheets, names, active sheet). Clears undo history. */
200
- loadWorkbook(workbook: SpreadsheetWorkbook): void;
200
+ /**
201
+ * Replaces the whole workbook (sheets, names, active sheet). Clears undo
202
+ * history, or with `undoable: true` records the replacement as one undo step.
203
+ */
204
+ loadWorkbook(workbook: SpreadsheetWorkbook, options?: {
205
+ undoable?: boolean;
206
+ }): void;
201
207
  /** The workbook as undo data; sheets leave out their copies of the names. */
202
208
  private serializeWorkbookSnapshot;
203
209
  private workbookSnapshot;
@@ -685,11 +691,18 @@ export declare class SpreadsheetController {
685
691
  undo: number;
686
692
  redo: number;
687
693
  };
688
- undo(): void;
689
- redo(): void;
694
+ /** Returns `false` when there was nothing to undo. */
695
+ undo(): boolean;
696
+ /** Returns `false` when there was nothing to redo. */
697
+ redo(): boolean;
690
698
  /** Restores the newest entry of `from`, saving the current state of the same scope on `to`. */
691
699
  private applyHistory;
692
700
  private notifyChange;
701
+ /**
702
+ * Calls `listener` after every change to the workbook's data (the moments
703
+ * `onDocumentChange` fires; not selection). Returns an unsubscribe function.
704
+ */
705
+ subscribe(listener: () => void): () => void;
693
706
  /** The sheet as rule evaluation sees it. */
694
707
  private ruleSheet;
695
708
  /**
@@ -125,6 +125,7 @@ export declare class SpreadsheetController {
125
125
  private boundSheetId;
126
126
  private names;
127
127
  private onSelectionChange?;
128
+ private readonly changeListeners;
128
129
  private onCellCommit?;
129
130
  private undoStack;
130
131
  private redoStack;
@@ -196,8 +197,13 @@ export declare class SpreadsheetController {
196
197
  * sheet's `names`).
197
198
  */
198
199
  getWorkbook(): SpreadsheetWorkbook;
199
- /** Replaces the whole workbook (sheets, names, active sheet). Clears undo history. */
200
- loadWorkbook(workbook: SpreadsheetWorkbook): void;
200
+ /**
201
+ * Replaces the whole workbook (sheets, names, active sheet). Clears undo
202
+ * history, or with `undoable: true` records the replacement as one undo step.
203
+ */
204
+ loadWorkbook(workbook: SpreadsheetWorkbook, options?: {
205
+ undoable?: boolean;
206
+ }): void;
201
207
  /** The workbook as undo data; sheets leave out their copies of the names. */
202
208
  private serializeWorkbookSnapshot;
203
209
  private workbookSnapshot;
@@ -685,11 +691,18 @@ export declare class SpreadsheetController {
685
691
  undo: number;
686
692
  redo: number;
687
693
  };
688
- undo(): void;
689
- redo(): void;
694
+ /** Returns `false` when there was nothing to undo. */
695
+ undo(): boolean;
696
+ /** Returns `false` when there was nothing to redo. */
697
+ redo(): boolean;
690
698
  /** Restores the newest entry of `from`, saving the current state of the same scope on `to`. */
691
699
  private applyHistory;
692
700
  private notifyChange;
701
+ /**
702
+ * Calls `listener` after every change to the workbook's data (the moments
703
+ * `onDocumentChange` fires; not selection). Returns an unsubscribe function.
704
+ */
705
+ subscribe(listener: () => void): () => void;
693
706
  /** The sheet as rule evaluation sees it. */
694
707
  private ruleSheet;
695
708
  /**
@@ -0,0 +1,9 @@
1
+ import { type EditorDocument } from '../persistence/editorDocument.cjs';
2
+ import type { SpreadsheetController } from './controller.cjs';
3
+ import type { SpreadsheetWorkbook } from './types.cjs';
4
+ /**
5
+ * The save / load / undo contract for a `SpreadsheetController` (kind `spreadsheet`, document:
6
+ * the whole workbook from `getWorkbook`: every sheet, the active sheet and the defined names).
7
+ * Recorded loads are one undo step. Selection and editing state are not part of the document.
8
+ */
9
+ export declare function createSpreadsheetEditorDocument(controller: SpreadsheetController): EditorDocument<SpreadsheetWorkbook>;
@@ -0,0 +1,9 @@
1
+ import { type EditorDocument } from '../persistence/editorDocument.js';
2
+ import type { SpreadsheetController } from './controller.js';
3
+ import type { SpreadsheetWorkbook } from './types.js';
4
+ /**
5
+ * The save / load / undo contract for a `SpreadsheetController` (kind `spreadsheet`, document:
6
+ * the whole workbook from `getWorkbook`: every sheet, the active sheet and the defined names).
7
+ * Recorded loads are one undo step. Selection and editing state are not part of the document.
8
+ */
9
+ export declare function createSpreadsheetEditorDocument(controller: SpreadsheetController): EditorDocument<SpreadsheetWorkbook>;
@@ -125,7 +125,8 @@
125
125
 
126
126
 
127
127
 
128
- var _chunkQSM3MDDJcjs = require('../chunk-QSM3MDDJ.cjs');
128
+
129
+ var _chunkXFDQEAOScjs = require('../chunk-XFDQEAOS.cjs');
129
130
 
130
131
 
131
132
 
@@ -197,6 +198,10 @@ var _chunk55AKPTLMcjs = require('../chunk-55AKPTLM.cjs');
197
198
 
198
199
 
199
200
  var _chunkN3KJFGXTcjs = require('../chunk-N3KJFGXT.cjs');
201
+ require('../chunk-5H2C3QSF.cjs');
202
+ require('../chunk-L5OWG2NA.cjs');
203
+ require('../chunk-2BSBFBOA.cjs');
204
+
200
205
 
201
206
 
202
207
 
@@ -389,4 +394,4 @@ var _chunkN3KJFGXTcjs = require('../chunk-N3KJFGXT.cjs');
389
394
 
390
395
 
391
396
 
392
- exports.CONDITIONAL_FORMAT_ICON_SETS = _chunkQSM3MDDJcjs.CONDITIONAL_FORMAT_ICON_SETS; exports.CONDITIONAL_FORMAT_PRESETS = _chunkQSM3MDDJcjs.CONDITIONAL_FORMAT_PRESETS; exports.CONDITIONAL_FORMAT_STYLE_PRESETS = _chunkQSM3MDDJcjs.CONDITIONAL_FORMAT_STYLE_PRESETS; exports.CONDITIONAL_FORMAT_TIME_PERIODS = _chunkQSM3MDDJcjs.CONDITIONAL_FORMAT_TIME_PERIODS; exports.ConditionalFormatEngine = _chunkQSM3MDDJcjs.ConditionalFormatEngine; exports.DATA_VALIDATION_ERROR_STYLE_OPTIONS = _chunkQSM3MDDJcjs.DATA_VALIDATION_ERROR_STYLE_OPTIONS; exports.DATA_VALIDATION_OPERATOR_OPTIONS = _chunkQSM3MDDJcjs.DATA_VALIDATION_OPERATOR_OPTIONS; exports.DATA_VALIDATION_TYPE_OPTIONS = _chunkQSM3MDDJcjs.DATA_VALIDATION_TYPE_OPTIONS; exports.DEFAULT_COLUMN_WIDTH = _chunkQSM3MDDJcjs.DEFAULT_COLUMN_WIDTH; exports.DEFAULT_CONDITIONAL_FORMAT_STYLE = _chunkQSM3MDDJcjs.DEFAULT_CONDITIONAL_FORMAT_STYLE; exports.DEFAULT_DATA_VALIDATION_MESSAGE = _chunkQSM3MDDJcjs.DEFAULT_DATA_VALIDATION_MESSAGE; exports.DEFAULT_DATA_VALIDATION_TITLE = _chunkQSM3MDDJcjs.DEFAULT_DATA_VALIDATION_TITLE; exports.DEFAULT_ROW_HEIGHT = _chunkQSM3MDDJcjs.DEFAULT_ROW_HEIGHT; exports.DataSourceBinder = _chunkQSM3MDDJcjs.DataSourceBinder; exports.DependencyGraph = _chunkQSM3MDDJcjs.DependencyGraph; exports.EMPTY_CONDITIONAL_FORMAT_OVERLAY = _chunkQSM3MDDJcjs.EMPTY_CONDITIONAL_FORMAT_OVERLAY; exports.FORMULA_ERRORS = _chunk55AKPTLMcjs.FORMULA_ERRORS; exports.FormulaEvaluator = _chunkQZFEX2N4cjs.FormulaEvaluator; exports.FormulaLambda = _chunkQZFEX2N4cjs.FormulaLambda; exports.FormulaParser = _chunkQZFEX2N4cjs.FormulaParser; exports.IntervalIndex = _chunkQSM3MDDJcjs.IntervalIndex; exports.MAX_DEFINED_NAME_LENGTH = _chunkQSM3MDDJcjs.MAX_DEFINED_NAME_LENGTH; exports.MAX_FORMULA_ARRAY_SIZE = _chunkQZFEX2N4cjs.MAX_FORMULA_ARRAY_SIZE; exports.MAX_LAMBDA_DEPTH = _chunkQZFEX2N4cjs.MAX_LAMBDA_DEPTH; exports.MAX_NUMBER_FORMAT_CODE_CHARS = _chunk55AKPTLMcjs.MAX_NUMBER_FORMAT_CODE_CHARS; exports.MAX_SHEET_NAME_LENGTH = _chunkQSM3MDDJcjs.MAX_SHEET_NAME_LENGTH; exports.NUMBER_FORMAT_PRESETS = _chunkQSM3MDDJcjs.NUMBER_FORMAT_PRESETS; exports.NumberFormat = _chunk55AKPTLMcjs.NumberFormat; exports.SPREADSHEET_CLIPBOARD_MIME = _chunkQSM3MDDJcjs.SPREADSHEET_CLIPBOARD_MIME; exports.SPREADSHEET_COLUMN_HEADER_HEIGHT = _chunkQSM3MDDJcjs.SPREADSHEET_COLUMN_HEADER_HEIGHT; exports.SPREADSHEET_DEFAULT_VIEWPORT = _chunkQSM3MDDJcjs.SPREADSHEET_DEFAULT_VIEWPORT; exports.SPREADSHEET_GROUP_ROW_HEIGHT = _chunkQSM3MDDJcjs.SPREADSHEET_GROUP_ROW_HEIGHT; exports.SPREADSHEET_IMPORT_ADAPTERS = _chunkQSM3MDDJcjs.SPREADSHEET_IMPORT_ADAPTERS; exports.SPREADSHEET_ROW_HEADER_WIDTH = _chunkQSM3MDDJcjs.SPREADSHEET_ROW_HEADER_WIDTH; exports.SPREADSHEET_TABLE_ACTIONS = _chunkQSM3MDDJcjs.SPREADSHEET_TABLE_ACTIONS; exports.SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD = _chunkQSM3MDDJcjs.SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD; exports.SPREADSHEET_VIRTUAL_ROW_THRESHOLD = _chunkQSM3MDDJcjs.SPREADSHEET_VIRTUAL_ROW_THRESHOLD; exports.SpreadsheetController = _chunkQSM3MDDJcjs.SpreadsheetController; exports.WHOLE_COLUMN_END_ROW = _chunkQZFEX2N4cjs.WHOLE_COLUMN_END_ROW; exports.adjustRangeForStructuralChange = _chunkQSM3MDDJcjs.adjustRangeForStructuralChange; exports.adjustRangesForStructuralChange = _chunkQSM3MDDJcjs.adjustRangesForStructuralChange; exports.aggregateValues = _chunkQZFEX2N4cjs.aggregateValues; exports.applyFormulaSuggestion = _chunkQSM3MDDJcjs.applyFormulaSuggestion; exports.bindSpreadsheetTableActions = _chunkQSM3MDDJcjs.bindSpreadsheetTableActions; exports.blendConditionalFormatColors = _chunkQSM3MDDJcjs.blendConditionalFormatColors; exports.buildSpreadsheetView = _chunkQSM3MDDJcjs.buildSpreadsheetView; exports.builtinNumberFormat = _chunk55AKPTLMcjs.builtinNumberFormat; exports.builtinNumberFormatId = _chunk55AKPTLMcjs.builtinNumberFormatId; exports.cellFormatForNumberFormat = _chunkQSM3MDDJcjs.cellFormatForNumberFormat; exports.checkFormulaArgumentCount = _chunkQZFEX2N4cjs.checkFormulaArgumentCount; exports.clampMenuPosition = _chunkQSM3MDDJcjs.clampMenuPosition; exports.clearNumberFormatCache = _chunk55AKPTLMcjs.clearNumberFormatCache; exports.colNameToIndex = _chunk55AKPTLMcjs.colNameToIndex; exports.columnDependencyKey = _chunkQSM3MDDJcjs.columnDependencyKey; exports.compareCellValues = _chunkQZFEX2N4cjs.compareCellValues; exports.compareNumbers = _chunk55AKPTLMcjs.compareNumbers; exports.compareValues = _chunk55AKPTLMcjs.compareValues; exports.computeFillTarget = _chunkQZFEX2N4cjs.computeFillTarget; exports.computeRowGroups = _chunkQSM3MDDJcjs.computeRowGroups; exports.conditionalFormatContrastColor = _chunkQSM3MDDJcjs.conditionalFormatContrastColor; exports.conditionalFormatIconCount = _chunkQSM3MDDJcjs.conditionalFormatIconCount; exports.conditionalFormatNumber = _chunkQSM3MDDJcjs.conditionalFormatNumber; exports.conditionalFormatStyleString = _chunkQSM3MDDJcjs.conditionalFormatStyleString; exports.copySheetName = _chunkQSM3MDDJcjs.copySheetName; exports.createConditionalFormatRule = _chunkQSM3MDDJcjs.createConditionalFormatRule; exports.createSpreadsheetClipboardData = _chunkQSM3MDDJcjs.createSpreadsheetClipboardData; exports.csvImportAdapter = _chunkQSM3MDDJcjs.csvImportAdapter; exports.dateValueToSerial = _chunk55AKPTLMcjs.dateValueToSerial; exports.defaultIconThresholds = _chunkQSM3MDDJcjs.defaultIconThresholds; exports.deleteSheetInFormula = _chunkQSM3MDDJcjs.deleteSheetInFormula; exports.describeConditionalFormat = _chunkQSM3MDDJcjs.describeConditionalFormat; exports.describeDataValidation = _chunkQSM3MDDJcjs.describeDataValidation; exports.describeFormulaError = _chunkQZFEX2N4cjs.describeFormulaError; exports.escapeCsvField = _chunkN3KJFGXTcjs.escapeCsvField; exports.evaluateConditionalFormats = _chunkQSM3MDDJcjs.evaluateConditionalFormats; exports.extractCellDependencies = _chunkQSM3MDDJcjs.extractCellDependencies; exports.extractNameDependencies = _chunkQSM3MDDJcjs.extractNameDependencies; exports.extractReferenceDependencies = _chunkQSM3MDDJcjs.extractReferenceDependencies; exports.fillSeries = _chunkQZFEX2N4cjs.fillSeries; exports.findDataValidation = _chunkQSM3MDDJcjs.findDataValidation; exports.findInvalidCells = _chunkQSM3MDDJcjs.findInvalidCells; exports.forEachRangeCell = _chunkQSM3MDDJcjs.forEachRangeCell; exports.formatCellDisplay = _chunkQSM3MDDJcjs.formatCellDisplay; exports.formatCellForDisplay = _chunkQSM3MDDJcjs.formatCellForDisplay; exports.formatGeneralFit = _chunk55AKPTLMcjs.formatGeneralFit; exports.formatNumberFormatValue = _chunk55AKPTLMcjs.formatNumberFormatValue; exports.formatRuleRanges = _chunkQSM3MDDJcjs.formatRuleRanges; exports.formatSheetPrefix = _chunkQSM3MDDJcjs.formatSheetPrefix; exports.formatTextFunction = _chunk55AKPTLMcjs.formatTextFunction; exports.formatValueWithCode = _chunkQSM3MDDJcjs.formatValueWithCode; exports.formulaIdentifiers = _chunkQSM3MDDJcjs.formulaIdentifiers; exports.fullSpreadsheetViewWindow = _chunkQSM3MDDJcjs.fullSpreadsheetViewWindow; exports.getConditionalFormatCss = _chunkQSM3MDDJcjs.getConditionalFormatCss; exports.getConditionalFormatIcon = _chunkQSM3MDDJcjs.getConditionalFormatIcon; exports.getDataBarCss = _chunkQSM3MDDJcjs.getDataBarCss; exports.getFillDirection = _chunkQZFEX2N4cjs.getFillDirection; exports.getFormulaArgumentSpecIndex = _chunkQZFEX2N4cjs.getFormulaArgumentSpecIndex; exports.getFormulaCaretContext = _chunkQSM3MDDJcjs.getFormulaCaretContext; exports.getFormulaFunction = _chunkQZFEX2N4cjs.getFormulaFunction; exports.getFormulaHints = _chunkQSM3MDDJcjs.getFormulaHints; exports.getFormulaSignature = _chunkQZFEX2N4cjs.getFormulaSignature; exports.getFormulaSignatureParts = _chunkQZFEX2N4cjs.getFormulaSignatureParts; exports.getNameManagerRows = _chunkQSM3MDDJcjs.getNameManagerRows; exports.getRowSection = _chunkQSM3MDDJcjs.getRowSection; exports.getSheetTabMenuItems = _chunkQSM3MDDJcjs.getSheetTabMenuItems; exports.getSpreadsheetMenuItems = _chunkQSM3MDDJcjs.getSpreadsheetMenuItems; exports.getSpreadsheetScrollToCell = _chunkQSM3MDDJcjs.getSpreadsheetScrollToCell; exports.getSpreadsheetViewWindow = _chunkQSM3MDDJcjs.getSpreadsheetViewWindow; exports.getTableSections = _chunkQSM3MDDJcjs.getTableSections; exports.getValidationListValues = _chunkQSM3MDDJcjs.getValidationListValues; exports.importFileIntoSpreadsheet = _chunkQSM3MDDJcjs.importFileIntoSpreadsheet; exports.indexToColName = _chunk55AKPTLMcjs.indexToColName; exports.isBlankValue = _chunkQZFEX2N4cjs.isBlankValue; exports.isFormulaError = _chunk55AKPTLMcjs.isFormulaError; exports.isFormulaLambda = _chunkQZFEX2N4cjs.isFormulaLambda; exports.isGeneralNumberFormat = _chunkQSM3MDDJcjs.isGeneralNumberFormat; exports.isLambdaDefinition = _chunkQSM3MDDJcjs.isLambdaDefinition; exports.isSingleCellRange = _chunkQZFEX2N4cjs.isSingleCellRange; exports.listFormulaFunctions = _chunkQZFEX2N4cjs.listFormulaFunctions; exports.mapConditionalFormatFormulas = _chunkQSM3MDDJcjs.mapConditionalFormatFormulas; exports.mapDataValidationFormulas = _chunkQSM3MDDJcjs.mapDataValidationFormulas; exports.mapFormulaReferences = _chunkQSM3MDDJcjs.mapFormulaReferences; exports.matchesFilterRule = _chunkQZFEX2N4cjs.matchesFilterRule; exports.matchesTimePeriod = _chunkQSM3MDDJcjs.matchesTimePeriod; exports.measureSpreadsheetView = _chunkQSM3MDDJcjs.measureSpreadsheetView; exports.mergeRuleRanges = _chunkQSM3MDDJcjs.mergeRuleRanges; exports.nextSheetName = _chunkQSM3MDDJcjs.nextSheetName; exports.normalizeRange = _chunkQZFEX2N4cjs.normalizeRange; exports.numberFormatColorToCss = _chunk55AKPTLMcjs.numberFormatColorToCss; exports.numberFormatForCellFormat = _chunkQSM3MDDJcjs.numberFormatForCellFormat; exports.numberToText = _chunk55AKPTLMcjs.numberToText; exports.offsetFormulaReferences = _chunkQSM3MDDJcjs.offsetFormulaReferences; exports.parseCellInput = _chunk55AKPTLMcjs.parseCellInput; exports.parseCellReference = _chunkQZFEX2N4cjs.parseCellReference; exports.parseCriteria = _chunkQZFEX2N4cjs.parseCriteria; exports.parseCsv = _chunkN3KJFGXTcjs.parseCsv; exports.parseFormula = _chunkQZFEX2N4cjs.parseFormula; exports.parseHtmlTable = _chunkQSM3MDDJcjs.parseHtmlTable; exports.parseNumberText = _chunk55AKPTLMcjs.parseNumberText; exports.parseRange = _chunkQZFEX2N4cjs.parseRange; exports.parseRuleRanges = _chunkQSM3MDDJcjs.parseRuleRanges; exports.parseSpreadsheetPlaybackRef = _chunkQZFEX2N4cjs.parseSpreadsheetPlaybackRef; exports.parseTsv = _chunkN3KJFGXTcjs.parseTsv; exports.planSpreadsheetToolPlayback = _chunkQZFEX2N4cjs.planSpreadsheetToolPlayback; exports.quoteSheetName = _chunkQSM3MDDJcjs.quoteSheetName; exports.rangeContains = _chunkQZFEX2N4cjs.rangeContains; exports.rangeContainsRange = _chunkQZFEX2N4cjs.rangeContainsRange; exports.rangeDependencyKey = _chunkQSM3MDDJcjs.rangeDependencyKey; exports.rangesContain = _chunkQSM3MDDJcjs.rangesContain; exports.rangesIntersect = _chunkQZFEX2N4cjs.rangesIntersect; exports.readSpreadsheetClipboard = _chunkQSM3MDDJcjs.readSpreadsheetClipboard; exports.reanchorRuleFormula = _chunkQSM3MDDJcjs.reanchorRuleFormula; exports.rebaseClipboardRows = _chunkQSM3MDDJcjs.rebaseClipboardRows; exports.registerFormulaFunction = _chunkQZFEX2N4cjs.registerFormulaFunction; exports.registerSpreadsheetImportAdapters = _chunkQSM3MDDJcjs.registerSpreadsheetImportAdapters; exports.remapFormulaReferences = _chunkQSM3MDDJcjs.remapFormulaReferences; exports.renameNameInFormula = _chunkQSM3MDDJcjs.renameNameInFormula; exports.renameSheetInFormula = _chunkQSM3MDDJcjs.renameSheetInFormula; exports.roundFloat = _chunkQZFEX2N4cjs.roundFloat; exports.rowPassesFilters = _chunkQSM3MDDJcjs.rowPassesFilters; exports.ruleAnchor = _chunkQSM3MDDJcjs.ruleAnchor; exports.ruleFormulaAt = _chunkQSM3MDDJcjs.ruleFormulaAt; exports.runSpreadsheetMenuItem = _chunkQSM3MDDJcjs.runSpreadsheetMenuItem; exports.sameSpreadsheetViewWindow = _chunkQSM3MDDJcjs.sameSpreadsheetViewWindow; exports.searchFormulaFunctions = _chunkQZFEX2N4cjs.searchFormulaFunctions; exports.serialFromYmd = _chunk55AKPTLMcjs.serialFromYmd; exports.serializeCsv = _chunkN3KJFGXTcjs.serializeCsv; exports.serializeHtmlTable = _chunkQSM3MDDJcjs.serializeHtmlTable; exports.serializeTsv = _chunkN3KJFGXTcjs.serializeTsv; exports.sheetDropIndex = _chunkQSM3MDDJcjs.sheetDropIndex; exports.sheetNameNeedsQuotes = _chunkQSM3MDDJcjs.sheetNameNeedsQuotes; exports.shiftFormulaReferences = _chunkQSM3MDDJcjs.shiftFormulaReferences; exports.shiftRuleFormula = _chunkQSM3MDDJcjs.shiftRuleFormula; exports.shouldVirtualizeSpreadsheet = _chunkQSM3MDDJcjs.shouldVirtualizeSpreadsheet; exports.sortCompareValues = _chunk55AKPTLMcjs.sortCompareValues; exports.sortRuleRanges = _chunkQSM3MDDJcjs.sortRuleRanges; exports.sortRules = _chunkQSM3MDDJcjs.sortRules; exports.subtractRange = _chunkQSM3MDDJcjs.subtractRange; exports.subtractRangeFromRanges = _chunkQSM3MDDJcjs.subtractRangeFromRanges; exports.toNumber = _chunkQZFEX2N4cjs.toNumber; exports.tokenizeFormula = _chunkQZFEX2N4cjs.tokenizeFormula; exports.transposeFormulaReferences = _chunkQSM3MDDJcjs.transposeFormulaReferences; exports.transposeRuleFormula = _chunkQSM3MDDJcjs.transposeRuleFormula; exports.transposeRuleRanges = _chunkQSM3MDDJcjs.transposeRuleRanges; exports.transposeRules = _chunkQSM3MDDJcjs.transposeRules; exports.tsvImportAdapter = _chunkQSM3MDDJcjs.tsvImportAdapter; exports.unregisterFormulaFunction = _chunkQZFEX2N4cjs.unregisterFormulaFunction; exports.validateCellInput = _chunkQSM3MDDJcjs.validateCellInput; exports.validateDefinedName = _chunkQSM3MDDJcjs.validateDefinedName; exports.validateSheetName = _chunkQSM3MDDJcjs.validateSheetName; exports.wildcardToRegExp = _chunkQZFEX2N4cjs.wildcardToRegExp;
397
+ exports.CONDITIONAL_FORMAT_ICON_SETS = _chunkXFDQEAOScjs.CONDITIONAL_FORMAT_ICON_SETS; exports.CONDITIONAL_FORMAT_PRESETS = _chunkXFDQEAOScjs.CONDITIONAL_FORMAT_PRESETS; exports.CONDITIONAL_FORMAT_STYLE_PRESETS = _chunkXFDQEAOScjs.CONDITIONAL_FORMAT_STYLE_PRESETS; exports.CONDITIONAL_FORMAT_TIME_PERIODS = _chunkXFDQEAOScjs.CONDITIONAL_FORMAT_TIME_PERIODS; exports.ConditionalFormatEngine = _chunkXFDQEAOScjs.ConditionalFormatEngine; exports.DATA_VALIDATION_ERROR_STYLE_OPTIONS = _chunkXFDQEAOScjs.DATA_VALIDATION_ERROR_STYLE_OPTIONS; exports.DATA_VALIDATION_OPERATOR_OPTIONS = _chunkXFDQEAOScjs.DATA_VALIDATION_OPERATOR_OPTIONS; exports.DATA_VALIDATION_TYPE_OPTIONS = _chunkXFDQEAOScjs.DATA_VALIDATION_TYPE_OPTIONS; exports.DEFAULT_COLUMN_WIDTH = _chunkXFDQEAOScjs.DEFAULT_COLUMN_WIDTH; exports.DEFAULT_CONDITIONAL_FORMAT_STYLE = _chunkXFDQEAOScjs.DEFAULT_CONDITIONAL_FORMAT_STYLE; exports.DEFAULT_DATA_VALIDATION_MESSAGE = _chunkXFDQEAOScjs.DEFAULT_DATA_VALIDATION_MESSAGE; exports.DEFAULT_DATA_VALIDATION_TITLE = _chunkXFDQEAOScjs.DEFAULT_DATA_VALIDATION_TITLE; exports.DEFAULT_ROW_HEIGHT = _chunkXFDQEAOScjs.DEFAULT_ROW_HEIGHT; exports.DataSourceBinder = _chunkXFDQEAOScjs.DataSourceBinder; exports.DependencyGraph = _chunkXFDQEAOScjs.DependencyGraph; exports.EMPTY_CONDITIONAL_FORMAT_OVERLAY = _chunkXFDQEAOScjs.EMPTY_CONDITIONAL_FORMAT_OVERLAY; exports.FORMULA_ERRORS = _chunk55AKPTLMcjs.FORMULA_ERRORS; exports.FormulaEvaluator = _chunkQZFEX2N4cjs.FormulaEvaluator; exports.FormulaLambda = _chunkQZFEX2N4cjs.FormulaLambda; exports.FormulaParser = _chunkQZFEX2N4cjs.FormulaParser; exports.IntervalIndex = _chunkXFDQEAOScjs.IntervalIndex; exports.MAX_DEFINED_NAME_LENGTH = _chunkXFDQEAOScjs.MAX_DEFINED_NAME_LENGTH; exports.MAX_FORMULA_ARRAY_SIZE = _chunkQZFEX2N4cjs.MAX_FORMULA_ARRAY_SIZE; exports.MAX_LAMBDA_DEPTH = _chunkQZFEX2N4cjs.MAX_LAMBDA_DEPTH; exports.MAX_NUMBER_FORMAT_CODE_CHARS = _chunk55AKPTLMcjs.MAX_NUMBER_FORMAT_CODE_CHARS; exports.MAX_SHEET_NAME_LENGTH = _chunkXFDQEAOScjs.MAX_SHEET_NAME_LENGTH; exports.NUMBER_FORMAT_PRESETS = _chunkXFDQEAOScjs.NUMBER_FORMAT_PRESETS; exports.NumberFormat = _chunk55AKPTLMcjs.NumberFormat; exports.SPREADSHEET_CLIPBOARD_MIME = _chunkXFDQEAOScjs.SPREADSHEET_CLIPBOARD_MIME; exports.SPREADSHEET_COLUMN_HEADER_HEIGHT = _chunkXFDQEAOScjs.SPREADSHEET_COLUMN_HEADER_HEIGHT; exports.SPREADSHEET_DEFAULT_VIEWPORT = _chunkXFDQEAOScjs.SPREADSHEET_DEFAULT_VIEWPORT; exports.SPREADSHEET_GROUP_ROW_HEIGHT = _chunkXFDQEAOScjs.SPREADSHEET_GROUP_ROW_HEIGHT; exports.SPREADSHEET_IMPORT_ADAPTERS = _chunkXFDQEAOScjs.SPREADSHEET_IMPORT_ADAPTERS; exports.SPREADSHEET_ROW_HEADER_WIDTH = _chunkXFDQEAOScjs.SPREADSHEET_ROW_HEADER_WIDTH; exports.SPREADSHEET_TABLE_ACTIONS = _chunkXFDQEAOScjs.SPREADSHEET_TABLE_ACTIONS; exports.SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD = _chunkXFDQEAOScjs.SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD; exports.SPREADSHEET_VIRTUAL_ROW_THRESHOLD = _chunkXFDQEAOScjs.SPREADSHEET_VIRTUAL_ROW_THRESHOLD; exports.SpreadsheetController = _chunkXFDQEAOScjs.SpreadsheetController; exports.WHOLE_COLUMN_END_ROW = _chunkQZFEX2N4cjs.WHOLE_COLUMN_END_ROW; exports.adjustRangeForStructuralChange = _chunkXFDQEAOScjs.adjustRangeForStructuralChange; exports.adjustRangesForStructuralChange = _chunkXFDQEAOScjs.adjustRangesForStructuralChange; exports.aggregateValues = _chunkQZFEX2N4cjs.aggregateValues; exports.applyFormulaSuggestion = _chunkXFDQEAOScjs.applyFormulaSuggestion; exports.bindSpreadsheetTableActions = _chunkXFDQEAOScjs.bindSpreadsheetTableActions; exports.blendConditionalFormatColors = _chunkXFDQEAOScjs.blendConditionalFormatColors; exports.buildSpreadsheetView = _chunkXFDQEAOScjs.buildSpreadsheetView; exports.builtinNumberFormat = _chunk55AKPTLMcjs.builtinNumberFormat; exports.builtinNumberFormatId = _chunk55AKPTLMcjs.builtinNumberFormatId; exports.cellFormatForNumberFormat = _chunkXFDQEAOScjs.cellFormatForNumberFormat; exports.checkFormulaArgumentCount = _chunkQZFEX2N4cjs.checkFormulaArgumentCount; exports.clampMenuPosition = _chunkXFDQEAOScjs.clampMenuPosition; exports.clearNumberFormatCache = _chunk55AKPTLMcjs.clearNumberFormatCache; exports.colNameToIndex = _chunk55AKPTLMcjs.colNameToIndex; exports.columnDependencyKey = _chunkXFDQEAOScjs.columnDependencyKey; exports.compareCellValues = _chunkQZFEX2N4cjs.compareCellValues; exports.compareNumbers = _chunk55AKPTLMcjs.compareNumbers; exports.compareValues = _chunk55AKPTLMcjs.compareValues; exports.computeFillTarget = _chunkQZFEX2N4cjs.computeFillTarget; exports.computeRowGroups = _chunkXFDQEAOScjs.computeRowGroups; exports.conditionalFormatContrastColor = _chunkXFDQEAOScjs.conditionalFormatContrastColor; exports.conditionalFormatIconCount = _chunkXFDQEAOScjs.conditionalFormatIconCount; exports.conditionalFormatNumber = _chunkXFDQEAOScjs.conditionalFormatNumber; exports.conditionalFormatStyleString = _chunkXFDQEAOScjs.conditionalFormatStyleString; exports.copySheetName = _chunkXFDQEAOScjs.copySheetName; exports.createConditionalFormatRule = _chunkXFDQEAOScjs.createConditionalFormatRule; exports.createSpreadsheetClipboardData = _chunkXFDQEAOScjs.createSpreadsheetClipboardData; exports.createSpreadsheetEditorDocument = _chunkXFDQEAOScjs.createSpreadsheetEditorDocument; exports.csvImportAdapter = _chunkXFDQEAOScjs.csvImportAdapter; exports.dateValueToSerial = _chunk55AKPTLMcjs.dateValueToSerial; exports.defaultIconThresholds = _chunkXFDQEAOScjs.defaultIconThresholds; exports.deleteSheetInFormula = _chunkXFDQEAOScjs.deleteSheetInFormula; exports.describeConditionalFormat = _chunkXFDQEAOScjs.describeConditionalFormat; exports.describeDataValidation = _chunkXFDQEAOScjs.describeDataValidation; exports.describeFormulaError = _chunkQZFEX2N4cjs.describeFormulaError; exports.escapeCsvField = _chunkN3KJFGXTcjs.escapeCsvField; exports.evaluateConditionalFormats = _chunkXFDQEAOScjs.evaluateConditionalFormats; exports.extractCellDependencies = _chunkXFDQEAOScjs.extractCellDependencies; exports.extractNameDependencies = _chunkXFDQEAOScjs.extractNameDependencies; exports.extractReferenceDependencies = _chunkXFDQEAOScjs.extractReferenceDependencies; exports.fillSeries = _chunkQZFEX2N4cjs.fillSeries; exports.findDataValidation = _chunkXFDQEAOScjs.findDataValidation; exports.findInvalidCells = _chunkXFDQEAOScjs.findInvalidCells; exports.forEachRangeCell = _chunkXFDQEAOScjs.forEachRangeCell; exports.formatCellDisplay = _chunkXFDQEAOScjs.formatCellDisplay; exports.formatCellForDisplay = _chunkXFDQEAOScjs.formatCellForDisplay; exports.formatGeneralFit = _chunk55AKPTLMcjs.formatGeneralFit; exports.formatNumberFormatValue = _chunk55AKPTLMcjs.formatNumberFormatValue; exports.formatRuleRanges = _chunkXFDQEAOScjs.formatRuleRanges; exports.formatSheetPrefix = _chunkXFDQEAOScjs.formatSheetPrefix; exports.formatTextFunction = _chunk55AKPTLMcjs.formatTextFunction; exports.formatValueWithCode = _chunkXFDQEAOScjs.formatValueWithCode; exports.formulaIdentifiers = _chunkXFDQEAOScjs.formulaIdentifiers; exports.fullSpreadsheetViewWindow = _chunkXFDQEAOScjs.fullSpreadsheetViewWindow; exports.getConditionalFormatCss = _chunkXFDQEAOScjs.getConditionalFormatCss; exports.getConditionalFormatIcon = _chunkXFDQEAOScjs.getConditionalFormatIcon; exports.getDataBarCss = _chunkXFDQEAOScjs.getDataBarCss; exports.getFillDirection = _chunkQZFEX2N4cjs.getFillDirection; exports.getFormulaArgumentSpecIndex = _chunkQZFEX2N4cjs.getFormulaArgumentSpecIndex; exports.getFormulaCaretContext = _chunkXFDQEAOScjs.getFormulaCaretContext; exports.getFormulaFunction = _chunkQZFEX2N4cjs.getFormulaFunction; exports.getFormulaHints = _chunkXFDQEAOScjs.getFormulaHints; exports.getFormulaSignature = _chunkQZFEX2N4cjs.getFormulaSignature; exports.getFormulaSignatureParts = _chunkQZFEX2N4cjs.getFormulaSignatureParts; exports.getNameManagerRows = _chunkXFDQEAOScjs.getNameManagerRows; exports.getRowSection = _chunkXFDQEAOScjs.getRowSection; exports.getSheetTabMenuItems = _chunkXFDQEAOScjs.getSheetTabMenuItems; exports.getSpreadsheetMenuItems = _chunkXFDQEAOScjs.getSpreadsheetMenuItems; exports.getSpreadsheetScrollToCell = _chunkXFDQEAOScjs.getSpreadsheetScrollToCell; exports.getSpreadsheetViewWindow = _chunkXFDQEAOScjs.getSpreadsheetViewWindow; exports.getTableSections = _chunkXFDQEAOScjs.getTableSections; exports.getValidationListValues = _chunkXFDQEAOScjs.getValidationListValues; exports.importFileIntoSpreadsheet = _chunkXFDQEAOScjs.importFileIntoSpreadsheet; exports.indexToColName = _chunk55AKPTLMcjs.indexToColName; exports.isBlankValue = _chunkQZFEX2N4cjs.isBlankValue; exports.isFormulaError = _chunk55AKPTLMcjs.isFormulaError; exports.isFormulaLambda = _chunkQZFEX2N4cjs.isFormulaLambda; exports.isGeneralNumberFormat = _chunkXFDQEAOScjs.isGeneralNumberFormat; exports.isLambdaDefinition = _chunkXFDQEAOScjs.isLambdaDefinition; exports.isSingleCellRange = _chunkQZFEX2N4cjs.isSingleCellRange; exports.listFormulaFunctions = _chunkQZFEX2N4cjs.listFormulaFunctions; exports.mapConditionalFormatFormulas = _chunkXFDQEAOScjs.mapConditionalFormatFormulas; exports.mapDataValidationFormulas = _chunkXFDQEAOScjs.mapDataValidationFormulas; exports.mapFormulaReferences = _chunkXFDQEAOScjs.mapFormulaReferences; exports.matchesFilterRule = _chunkQZFEX2N4cjs.matchesFilterRule; exports.matchesTimePeriod = _chunkXFDQEAOScjs.matchesTimePeriod; exports.measureSpreadsheetView = _chunkXFDQEAOScjs.measureSpreadsheetView; exports.mergeRuleRanges = _chunkXFDQEAOScjs.mergeRuleRanges; exports.nextSheetName = _chunkXFDQEAOScjs.nextSheetName; exports.normalizeRange = _chunkQZFEX2N4cjs.normalizeRange; exports.numberFormatColorToCss = _chunk55AKPTLMcjs.numberFormatColorToCss; exports.numberFormatForCellFormat = _chunkXFDQEAOScjs.numberFormatForCellFormat; exports.numberToText = _chunk55AKPTLMcjs.numberToText; exports.offsetFormulaReferences = _chunkXFDQEAOScjs.offsetFormulaReferences; exports.parseCellInput = _chunk55AKPTLMcjs.parseCellInput; exports.parseCellReference = _chunkQZFEX2N4cjs.parseCellReference; exports.parseCriteria = _chunkQZFEX2N4cjs.parseCriteria; exports.parseCsv = _chunkN3KJFGXTcjs.parseCsv; exports.parseFormula = _chunkQZFEX2N4cjs.parseFormula; exports.parseHtmlTable = _chunkXFDQEAOScjs.parseHtmlTable; exports.parseNumberText = _chunk55AKPTLMcjs.parseNumberText; exports.parseRange = _chunkQZFEX2N4cjs.parseRange; exports.parseRuleRanges = _chunkXFDQEAOScjs.parseRuleRanges; exports.parseSpreadsheetPlaybackRef = _chunkQZFEX2N4cjs.parseSpreadsheetPlaybackRef; exports.parseTsv = _chunkN3KJFGXTcjs.parseTsv; exports.planSpreadsheetToolPlayback = _chunkQZFEX2N4cjs.planSpreadsheetToolPlayback; exports.quoteSheetName = _chunkXFDQEAOScjs.quoteSheetName; exports.rangeContains = _chunkQZFEX2N4cjs.rangeContains; exports.rangeContainsRange = _chunkQZFEX2N4cjs.rangeContainsRange; exports.rangeDependencyKey = _chunkXFDQEAOScjs.rangeDependencyKey; exports.rangesContain = _chunkXFDQEAOScjs.rangesContain; exports.rangesIntersect = _chunkQZFEX2N4cjs.rangesIntersect; exports.readSpreadsheetClipboard = _chunkXFDQEAOScjs.readSpreadsheetClipboard; exports.reanchorRuleFormula = _chunkXFDQEAOScjs.reanchorRuleFormula; exports.rebaseClipboardRows = _chunkXFDQEAOScjs.rebaseClipboardRows; exports.registerFormulaFunction = _chunkQZFEX2N4cjs.registerFormulaFunction; exports.registerSpreadsheetImportAdapters = _chunkXFDQEAOScjs.registerSpreadsheetImportAdapters; exports.remapFormulaReferences = _chunkXFDQEAOScjs.remapFormulaReferences; exports.renameNameInFormula = _chunkXFDQEAOScjs.renameNameInFormula; exports.renameSheetInFormula = _chunkXFDQEAOScjs.renameSheetInFormula; exports.roundFloat = _chunkQZFEX2N4cjs.roundFloat; exports.rowPassesFilters = _chunkXFDQEAOScjs.rowPassesFilters; exports.ruleAnchor = _chunkXFDQEAOScjs.ruleAnchor; exports.ruleFormulaAt = _chunkXFDQEAOScjs.ruleFormulaAt; exports.runSpreadsheetMenuItem = _chunkXFDQEAOScjs.runSpreadsheetMenuItem; exports.sameSpreadsheetViewWindow = _chunkXFDQEAOScjs.sameSpreadsheetViewWindow; exports.searchFormulaFunctions = _chunkQZFEX2N4cjs.searchFormulaFunctions; exports.serialFromYmd = _chunk55AKPTLMcjs.serialFromYmd; exports.serializeCsv = _chunkN3KJFGXTcjs.serializeCsv; exports.serializeHtmlTable = _chunkXFDQEAOScjs.serializeHtmlTable; exports.serializeTsv = _chunkN3KJFGXTcjs.serializeTsv; exports.sheetDropIndex = _chunkXFDQEAOScjs.sheetDropIndex; exports.sheetNameNeedsQuotes = _chunkXFDQEAOScjs.sheetNameNeedsQuotes; exports.shiftFormulaReferences = _chunkXFDQEAOScjs.shiftFormulaReferences; exports.shiftRuleFormula = _chunkXFDQEAOScjs.shiftRuleFormula; exports.shouldVirtualizeSpreadsheet = _chunkXFDQEAOScjs.shouldVirtualizeSpreadsheet; exports.sortCompareValues = _chunk55AKPTLMcjs.sortCompareValues; exports.sortRuleRanges = _chunkXFDQEAOScjs.sortRuleRanges; exports.sortRules = _chunkXFDQEAOScjs.sortRules; exports.subtractRange = _chunkXFDQEAOScjs.subtractRange; exports.subtractRangeFromRanges = _chunkXFDQEAOScjs.subtractRangeFromRanges; exports.toNumber = _chunkQZFEX2N4cjs.toNumber; exports.tokenizeFormula = _chunkQZFEX2N4cjs.tokenizeFormula; exports.transposeFormulaReferences = _chunkXFDQEAOScjs.transposeFormulaReferences; exports.transposeRuleFormula = _chunkXFDQEAOScjs.transposeRuleFormula; exports.transposeRuleRanges = _chunkXFDQEAOScjs.transposeRuleRanges; exports.transposeRules = _chunkXFDQEAOScjs.transposeRules; exports.tsvImportAdapter = _chunkXFDQEAOScjs.tsvImportAdapter; exports.unregisterFormulaFunction = _chunkQZFEX2N4cjs.unregisterFormulaFunction; exports.validateCellInput = _chunkXFDQEAOScjs.validateCellInput; exports.validateDefinedName = _chunkXFDQEAOScjs.validateDefinedName; exports.validateSheetName = _chunkXFDQEAOScjs.validateSheetName; exports.wildcardToRegExp = _chunkQZFEX2N4cjs.wildcardToRegExp;
@@ -18,3 +18,4 @@ export * from './validation/index.cjs';
18
18
  export * from './rule-ranges.cjs';
19
19
  export * from './viewport.cjs';
20
20
  export * from './playback.cjs';
21
+ export * from './editorDocument.cjs';
@@ -18,3 +18,4 @@ export * from './validation/index.js';
18
18
  export * from './rule-ranges.js';
19
19
  export * from './viewport.js';
20
20
  export * from './playback.js';
21
+ export * from './editorDocument.js';
@@ -46,6 +46,7 @@ import {
46
46
  copySheetName,
47
47
  createConditionalFormatRule,
48
48
  createSpreadsheetClipboardData,
49
+ createSpreadsheetEditorDocument,
49
50
  csvImportAdapter,
50
51
  defaultIconThresholds,
51
52
  deleteSheetInFormula,
@@ -125,7 +126,7 @@ import {
125
126
  validateCellInput,
126
127
  validateDefinedName,
127
128
  validateSheetName
128
- } from "../chunk-VGJTUCWM.js";
129
+ } from "../chunk-4J4MC3F5.js";
129
130
  import {
130
131
  FormulaEvaluator,
131
132
  FormulaLambda,
@@ -197,6 +198,9 @@ import {
197
198
  serializeCsv,
198
199
  serializeTsv
199
200
  } from "../chunk-WJSD3MAZ.js";
201
+ import "../chunk-GNV54DLO.js";
202
+ import "../chunk-WHKNYFM2.js";
203
+ import "../chunk-HF5QZS7Z.js";
200
204
  export {
201
205
  CONDITIONAL_FORMAT_ICON_SETS,
202
206
  CONDITIONAL_FORMAT_PRESETS,
@@ -264,6 +268,7 @@ export {
264
268
  copySheetName,
265
269
  createConditionalFormatRule,
266
270
  createSpreadsheetClipboardData,
271
+ createSpreadsheetEditorDocument,
267
272
  csvImportAdapter,
268
273
  dateValueToSerial,
269
274
  defaultIconThresholds,
@@ -0,0 +1,10 @@
1
+ import { type EditorDocument } from '../persistence/editorDocument.cjs';
2
+ import type { TokenState } from './types.cjs';
3
+ import type { TokenStore } from './store.cjs';
4
+ /**
5
+ * The save / load / undo contract for a `TokenStore` (kind `tokens`, document: the
6
+ * `TokenState` of collections, modes and variables). A recorded load (agents) is one undo step
7
+ * and refuses a state with any problem; opening a file (`history: "reset"`) keeps what
8
+ * `parseTokenState` can read and reports the rest in the `LoadReport`.
9
+ */
10
+ export declare function createTokensEditorDocument(store: TokenStore): EditorDocument<TokenState>;
@@ -0,0 +1,10 @@
1
+ import { type EditorDocument } from '../persistence/editorDocument.js';
2
+ import type { TokenState } from './types.js';
3
+ import type { TokenStore } from './store.js';
4
+ /**
5
+ * The save / load / undo contract for a `TokenStore` (kind `tokens`, document: the
6
+ * `TokenState` of collections, modes and variables). A recorded load (agents) is one undo step
7
+ * and refuses a state with any problem; opening a file (`history: "reset"`) keeps what
8
+ * `parseTokenState` can read and reports the rest in the `LoadReport`.
9
+ */
10
+ export declare function createTokensEditorDocument(store: TokenStore): EditorDocument<TokenState>;
@@ -51,7 +51,11 @@
51
51
 
52
52
 
53
53
 
54
- var _chunk2ZO4RSDScjs = require('../chunk-2ZO4RSDS.cjs');
54
+
55
+ var _chunkHVX35M2Icjs = require('../chunk-HVX35M2I.cjs');
56
+ require('../chunk-5H2C3QSF.cjs');
57
+ require('../chunk-L5OWG2NA.cjs');
58
+ require('../chunk-2BSBFBOA.cjs');
55
59
 
56
60
 
57
61
 
@@ -113,4 +117,5 @@ var _chunkA6QWKBJPcjs = require('../chunk-A6QWKBJP.cjs');
113
117
 
114
118
 
115
119
 
116
- exports.EMPTY_TOKEN_STATE = _chunk2ZO4RSDScjs.EMPTY_TOKEN_STATE; exports.TOKEN_SCOPES_BY_TYPE = _chunk2ZO4RSDScjs.TOKEN_SCOPES_BY_TYPE; exports.TOKEN_TYPES = _chunk2ZO4RSDScjs.TOKEN_TYPES; exports.TokenError = _chunk2ZO4RSDScjs.TokenError; exports.TokenStore = _chunk2ZO4RSDScjs.TokenStore; exports.W3C_TOKENS_EXTENSION = _chunk2ZO4RSDScjs.W3C_TOKENS_EXTENSION; exports.addTokenMode = _chunk2ZO4RSDScjs.addTokenMode; exports.checkTokenAlias = _chunk2ZO4RSDScjs.checkTokenAlias; exports.coerceTokenLiteral = _chunk2ZO4RSDScjs.coerceTokenLiteral; exports.createTokenCollection = _chunk2ZO4RSDScjs.createTokenCollection; exports.createTokenStore = _chunk2ZO4RSDScjs.createTokenStore; exports.createTokenVariable = _chunk2ZO4RSDScjs.createTokenVariable; exports.cssString = _chunk2ZO4RSDScjs.cssString; exports.defaultTokenId = _chunk2ZO4RSDScjs.defaultTokenId; exports.defaultTokenValue = _chunk2ZO4RSDScjs.defaultTokenValue; exports.deleteTokenCollection = _chunk2ZO4RSDScjs.deleteTokenCollection; exports.deleteTokenVariables = _chunk2ZO4RSDScjs.deleteTokenVariables; exports.exportTokensCss = _chunk2ZO4RSDScjs.exportTokensCss; exports.exportW3CTokens = _chunk2ZO4RSDScjs.exportW3CTokens; exports.exportW3CTokensJson = _chunk2ZO4RSDScjs.exportW3CTokensJson; exports.findTokenCollection = _chunk2ZO4RSDScjs.findTokenCollection; exports.findTokenMode = _chunk2ZO4RSDScjs.findTokenMode; exports.findTokenVariable = _chunk2ZO4RSDScjs.findTokenVariable; exports.formatTokenCssValue = _chunk2ZO4RSDScjs.formatTokenCssValue; exports.formatTokenValue = _chunk2ZO4RSDScjs.formatTokenValue; exports.getCollectionVariables = _chunk2ZO4RSDScjs.getCollectionVariables; exports.getCurrentMode = _chunk2ZO4RSDScjs.getCurrentMode; exports.getDefaultMode = _chunk2ZO4RSDScjs.getDefaultMode; exports.getTokenCollection = _chunk2ZO4RSDScjs.getTokenCollection; exports.getTokenCssName = _chunk2ZO4RSDScjs.getTokenCssName; exports.getTokenCssVariables = _chunk2ZO4RSDScjs.getTokenCssVariables; exports.getTokenVariable = _chunk2ZO4RSDScjs.getTokenVariable; exports.hexToRgba = _chunkA6QWKBJPcjs.hexToRgba; exports.importW3CTokens = _chunk2ZO4RSDScjs.importW3CTokens; exports.isTokenAlias = _chunk2ZO4RSDScjs.isTokenAlias; exports.isTokenInScope = _chunk2ZO4RSDScjs.isTokenInScope; exports.isTokenScopeKnown = _chunk2ZO4RSDScjs.isTokenScopeKnown; exports.literalTokenType = _chunk2ZO4RSDScjs.literalTokenType; exports.moveTokenMode = _chunk2ZO4RSDScjs.moveTokenMode; exports.normalizeTokenColor = _chunkA6QWKBJPcjs.normalizeTokenColor; exports.normalizeTokenName = _chunk2ZO4RSDScjs.normalizeTokenName; exports.normalizeTokenScopes = _chunk2ZO4RSDScjs.normalizeTokenScopes; exports.parseTokenState = _chunk2ZO4RSDScjs.parseTokenState; exports.prepareTokenValue = _chunk2ZO4RSDScjs.prepareTokenValue; exports.removeTokenMode = _chunk2ZO4RSDScjs.removeTokenMode; exports.renameTokenCollection = _chunk2ZO4RSDScjs.renameTokenCollection; exports.renameTokenMode = _chunk2ZO4RSDScjs.renameTokenMode; exports.renameTokenVariable = _chunk2ZO4RSDScjs.renameTokenVariable; exports.resolveToken = _chunk2ZO4RSDScjs.resolveToken; exports.resolveTokenInMode = _chunk2ZO4RSDScjs.resolveTokenInMode; exports.resolveTokenValue = _chunk2ZO4RSDScjs.resolveTokenValue; exports.rgbaToHex = _chunkA6QWKBJPcjs.rgbaToHex; exports.setTokenValue = _chunk2ZO4RSDScjs.setTokenValue; exports.tokenSlug = _chunk2ZO4RSDScjs.tokenSlug; exports.updateTokenVariable = _chunk2ZO4RSDScjs.updateTokenVariable;
120
+
121
+ exports.EMPTY_TOKEN_STATE = _chunkHVX35M2Icjs.EMPTY_TOKEN_STATE; exports.TOKEN_SCOPES_BY_TYPE = _chunkHVX35M2Icjs.TOKEN_SCOPES_BY_TYPE; exports.TOKEN_TYPES = _chunkHVX35M2Icjs.TOKEN_TYPES; exports.TokenError = _chunkHVX35M2Icjs.TokenError; exports.TokenStore = _chunkHVX35M2Icjs.TokenStore; exports.W3C_TOKENS_EXTENSION = _chunkHVX35M2Icjs.W3C_TOKENS_EXTENSION; exports.addTokenMode = _chunkHVX35M2Icjs.addTokenMode; exports.checkTokenAlias = _chunkHVX35M2Icjs.checkTokenAlias; exports.coerceTokenLiteral = _chunkHVX35M2Icjs.coerceTokenLiteral; exports.createTokenCollection = _chunkHVX35M2Icjs.createTokenCollection; exports.createTokenStore = _chunkHVX35M2Icjs.createTokenStore; exports.createTokenVariable = _chunkHVX35M2Icjs.createTokenVariable; exports.createTokensEditorDocument = _chunkHVX35M2Icjs.createTokensEditorDocument; exports.cssString = _chunkHVX35M2Icjs.cssString; exports.defaultTokenId = _chunkHVX35M2Icjs.defaultTokenId; exports.defaultTokenValue = _chunkHVX35M2Icjs.defaultTokenValue; exports.deleteTokenCollection = _chunkHVX35M2Icjs.deleteTokenCollection; exports.deleteTokenVariables = _chunkHVX35M2Icjs.deleteTokenVariables; exports.exportTokensCss = _chunkHVX35M2Icjs.exportTokensCss; exports.exportW3CTokens = _chunkHVX35M2Icjs.exportW3CTokens; exports.exportW3CTokensJson = _chunkHVX35M2Icjs.exportW3CTokensJson; exports.findTokenCollection = _chunkHVX35M2Icjs.findTokenCollection; exports.findTokenMode = _chunkHVX35M2Icjs.findTokenMode; exports.findTokenVariable = _chunkHVX35M2Icjs.findTokenVariable; exports.formatTokenCssValue = _chunkHVX35M2Icjs.formatTokenCssValue; exports.formatTokenValue = _chunkHVX35M2Icjs.formatTokenValue; exports.getCollectionVariables = _chunkHVX35M2Icjs.getCollectionVariables; exports.getCurrentMode = _chunkHVX35M2Icjs.getCurrentMode; exports.getDefaultMode = _chunkHVX35M2Icjs.getDefaultMode; exports.getTokenCollection = _chunkHVX35M2Icjs.getTokenCollection; exports.getTokenCssName = _chunkHVX35M2Icjs.getTokenCssName; exports.getTokenCssVariables = _chunkHVX35M2Icjs.getTokenCssVariables; exports.getTokenVariable = _chunkHVX35M2Icjs.getTokenVariable; exports.hexToRgba = _chunkA6QWKBJPcjs.hexToRgba; exports.importW3CTokens = _chunkHVX35M2Icjs.importW3CTokens; exports.isTokenAlias = _chunkHVX35M2Icjs.isTokenAlias; exports.isTokenInScope = _chunkHVX35M2Icjs.isTokenInScope; exports.isTokenScopeKnown = _chunkHVX35M2Icjs.isTokenScopeKnown; exports.literalTokenType = _chunkHVX35M2Icjs.literalTokenType; exports.moveTokenMode = _chunkHVX35M2Icjs.moveTokenMode; exports.normalizeTokenColor = _chunkA6QWKBJPcjs.normalizeTokenColor; exports.normalizeTokenName = _chunkHVX35M2Icjs.normalizeTokenName; exports.normalizeTokenScopes = _chunkHVX35M2Icjs.normalizeTokenScopes; exports.parseTokenState = _chunkHVX35M2Icjs.parseTokenState; exports.prepareTokenValue = _chunkHVX35M2Icjs.prepareTokenValue; exports.removeTokenMode = _chunkHVX35M2Icjs.removeTokenMode; exports.renameTokenCollection = _chunkHVX35M2Icjs.renameTokenCollection; exports.renameTokenMode = _chunkHVX35M2Icjs.renameTokenMode; exports.renameTokenVariable = _chunkHVX35M2Icjs.renameTokenVariable; exports.resolveToken = _chunkHVX35M2Icjs.resolveToken; exports.resolveTokenInMode = _chunkHVX35M2Icjs.resolveTokenInMode; exports.resolveTokenValue = _chunkHVX35M2Icjs.resolveTokenValue; exports.rgbaToHex = _chunkA6QWKBJPcjs.rgbaToHex; exports.setTokenValue = _chunkHVX35M2Icjs.setTokenValue; exports.tokenSlug = _chunkHVX35M2Icjs.tokenSlug; exports.updateTokenVariable = _chunkHVX35M2Icjs.updateTokenVariable;
@@ -9,3 +9,4 @@ export * from './model.cjs';
9
9
  export * from './store.cjs';
10
10
  export * from './css.cjs';
11
11
  export * from './w3c.cjs';
12
+ export * from './editorDocument.cjs';
@@ -9,3 +9,4 @@ export * from './model.js';
9
9
  export * from './store.js';
10
10
  export * from './css.js';
11
11
  export * from './w3c.js';
12
+ export * from './editorDocument.js';
@@ -11,6 +11,7 @@ import {
11
11
  createTokenCollection,
12
12
  createTokenStore,
13
13
  createTokenVariable,
14
+ createTokensEditorDocument,
14
15
  cssString,
15
16
  defaultTokenId,
16
17
  defaultTokenValue,
@@ -51,7 +52,10 @@ import {
51
52
  setTokenValue,
52
53
  tokenSlug,
53
54
  updateTokenVariable
54
- } from "../chunk-LFKLA7RC.js";
55
+ } from "../chunk-BCY22GBH.js";
56
+ import "../chunk-GNV54DLO.js";
57
+ import "../chunk-WHKNYFM2.js";
58
+ import "../chunk-HF5QZS7Z.js";
55
59
  import {
56
60
  hexToRgba,
57
61
  normalizeTokenColor,
@@ -70,6 +74,7 @@ export {
70
74
  createTokenCollection,
71
75
  createTokenStore,
72
76
  createTokenVariable,
77
+ createTokensEditorDocument,
73
78
  cssString,
74
79
  defaultTokenId,
75
80
  defaultTokenValue,
@@ -41,9 +41,6 @@ var _chunkQT26RHKKcjs = require('../chunk-QT26RHKK.cjs');
41
41
  var _chunkLIXLD433cjs = require('../chunk-LIXLD433.cjs');
42
42
 
43
43
 
44
- var _chunk5H2C3QSFcjs = require('../chunk-5H2C3QSF.cjs');
45
-
46
-
47
44
 
48
45
 
49
46
 
@@ -515,7 +512,6 @@ require('../chunk-BXMIBMVG.cjs');
515
512
 
516
513
 
517
514
  var _chunkCVFAAZXEcjs = require('../chunk-CVFAAZXE.cjs');
518
- require('../chunk-L5OWG2NA.cjs');
519
515
 
520
516
 
521
517
 
@@ -562,6 +558,10 @@ var _chunkCWM3CUUXcjs = require('../chunk-CWM3CUUX.cjs');
562
558
  var _chunkXFM3OCHUcjs = require('../chunk-XFM3OCHU.cjs');
563
559
  require('../chunk-NIBFDFYW.cjs');
564
560
  require('../chunk-UWEQ55MY.cjs');
561
+
562
+
563
+ var _chunk5H2C3QSFcjs = require('../chunk-5H2C3QSF.cjs');
564
+ require('../chunk-L5OWG2NA.cjs');
565
565
  require('../chunk-2BSBFBOA.cjs');
566
566
 
567
567
 
@@ -39,9 +39,6 @@ import {
39
39
  subpathToMorphContour,
40
40
  turnMorphContour
41
41
  } from "../chunk-UILRJQFD.js";
42
- import {
43
- defineEditorDocument
44
- } from "../chunk-GNV54DLO.js";
45
42
  import {
46
43
  DEFAULT_VECTOR_FONT,
47
44
  IDENTITY_MATRIX,
@@ -515,7 +512,6 @@ import "../chunk-ORDXMBD4.js";
515
512
  import {
516
513
  createProvenance
517
514
  } from "../chunk-M6DNZNVY.js";
518
- import "../chunk-WHKNYFM2.js";
519
515
  import {
520
516
  bezierPathBounds,
521
517
  bezierPathToSvg,
@@ -562,6 +558,10 @@ import {
562
558
  } from "../chunk-QGHEDC7B.js";
563
559
  import "../chunk-SIFAIGB3.js";
564
560
  import "../chunk-VDGBHYC7.js";
561
+ import {
562
+ defineEditorDocument
563
+ } from "../chunk-GNV54DLO.js";
564
+ import "../chunk-WHKNYFM2.js";
565
565
  import "../chunk-HF5QZS7Z.js";
566
566
  import {
567
567
  HistoryManager
@@ -141,14 +141,14 @@ require('../chunk-PY4GWSE2.cjs');
141
141
  var _chunkEBDZWIOPcjs = require('../chunk-EBDZWIOP.cjs');
142
142
 
143
143
 
144
- var _chunk5H2C3QSFcjs = require('../chunk-5H2C3QSF.cjs');
145
- require('../chunk-L5OWG2NA.cjs');
146
-
147
-
148
144
 
149
145
 
150
146
  var _chunkRUZQMYXHcjs = require('../chunk-RUZQMYXH.cjs');
151
147
  require('../chunk-WOFXZ3XU.cjs');
148
+
149
+
150
+ var _chunk5H2C3QSFcjs = require('../chunk-5H2C3QSF.cjs');
151
+ require('../chunk-L5OWG2NA.cjs');
152
152
  require('../chunk-2BSBFBOA.cjs');
153
153
 
154
154
 
@@ -139,16 +139,16 @@ import "../chunk-EHLOCVWB.js";
139
139
  import {
140
140
  namedWithSuggestion
141
141
  } from "../chunk-W4KFNAWC.js";
142
- import {
143
- defineEditorDocument
144
- } from "../chunk-GNV54DLO.js";
145
- import "../chunk-WHKNYFM2.js";
146
142
  import {
147
143
  EffectsSlot,
148
144
  createEffectToolProvider,
149
145
  isEffectError
150
146
  } from "../chunk-7KWJEYIK.js";
151
147
  import "../chunk-V2ZCJRDM.js";
148
+ import {
149
+ defineEditorDocument
150
+ } from "../chunk-GNV54DLO.js";
151
+ import "../chunk-WHKNYFM2.js";
152
152
  import "../chunk-HF5QZS7Z.js";
153
153
  import {
154
154
  HistoryManager
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.152.0",
3
+ "version": "0.153.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
package/skills/README.md CHANGED
@@ -20,6 +20,7 @@ that uses the tools can load the matching skill.
20
20
  | [`pixerate-video-editor`](pixerate-video-editor/SKILL.md) | Non-linear video editing: tracks, clips, transitions, export. |
21
21
  | [`pixerate-generation`](pixerate-generation/SKILL.md) | Planning, estimating and running paid media generation. |
22
22
  | [`pixerate-parameters`](pixerate-parameters/SKILL.md) | Effect parameters, presets and keyframes. |
23
+ | [`pixerate-tokens`](pixerate-tokens/SKILL.md) | Design tokens: collections, modes, variables and aliases, through the whole-set document tools. |
23
24
  | [`pixerate-effect-authoring`](pixerate-effect-authoring/SKILL.md) | Authoring shaders and procedural effects: inspecting parameters and source code, setting values and presets, keyframing animation tracks, playback timing, and previewing. |
24
25
  | [`pixerate-color`](pixerate-color/SKILL.md) | Colour inspection, WCAG accessibility and contrast optimization, CVD simulation, palette audits, harmonies, and OKLab/OKLCH blends. |
25
26
 
@@ -106,6 +106,20 @@ Errors, namespacing (`doc-1__find_text`) and `run_commands` batching are covered
106
106
  | `prompt_set_variable` | Set the value of a template variable (`name` without braces, `value` any JSON value). Prefer this over editing the prompt text when only a slot's value changes. |
107
107
  | `prompt_select` | Select prompt text between two positions (`from === to` places the cursor), e.g. to show the user what you changed. |
108
108
 
109
+ ### Save and open
110
+
111
+ The host may add the shared document tools (see `pixerate-agent-tools`). A rich text document is the editor's ProseMirror JSON (`{ "type": "doc", "content": [...] }`), with marks such as tracked changes and comment anchors; comment threads stay in their own store.
112
+
113
+ | Tool | Use |
114
+ | --- | --- |
115
+ | `get_rich_text_document` | Take a copy of the whole document as `{ kind, formatVersion, revision, document }` before a risky rewrite, or to hand it on. To read the document, use `get_text`: it is smaller and says more. Refuses very large documents. |
116
+ | `load_rich_text_document` | Put back a copy from `get_rich_text_document` (its `document`, or the whole result). Checked first: when anything is wrong nothing changes and the error says what. One undo step (`undo_rich_text` brings the previous document back). Refused while the document is read-only. To change text use `replace_range`, `replace_text` or `insert_text`: they keep formatting and comments. |
117
+ | `undo_rich_text` | Undo the last document edit (one tool call or one user gesture). Returns `undone` (the step's name, when it has one) and whether more can be undone. Fails with "Nothing to undo." when there is nothing. |
118
+ | `redo_rich_text` | Redo the last undone document edit. |
119
+ | `save_rich_text_document` | Save the document under a `name` in the host's storage (the same name replaces that copy). Returns the `key`. Only listed when the host has storage. Save when the user asks, not after every edit. |
120
+ | `list_saved_rich_text_documents` | List saved documents (`key`, `name`, `savedAt`), newest first. |
121
+ | `open_saved_rich_text_document` | Replace the document with a saved one by `key`. One undo step. Ask before opening over changes the user has not saved. |
122
+
109
123
  ## Commands
110
124
 
111
125
  Run with `run_command` / `run_commands` when the host registers them. Check
@@ -107,6 +107,20 @@ cell was deleted), `#NAME?`, `#N/A` (lookup miss), `#NUM!`, `#CYCLE!` (circular
107
107
  | `unmerge_cells` | Split every merge touching a `range` (a single cell is enough) back into cells; the value stays top-left. Returns the ranges unmerged; fails when there are none (`get_range` lists them). Unmerge before sorting, filtering or transposing a region. |
108
108
  | `transpose_range` | Swap rows and columns of a `range` in place, anchored at its top-left (`A1:C2` becomes `A1:B3`), moving values, formulas and formats; formulas that pointed into the range follow their cells. Cells the new shape covers outside the old range are overwritten, so check that area is empty first. Refused across merges (unmerge first), read-only cells or spills. Returns the new range. |
109
109
 
110
+ ### Save and open
111
+
112
+ The host may add the shared document tools (see `pixerate-agent-tools`). A spreadsheet document is the whole workbook: `{ sheets: [{ columns, rows, cells, ... }], activeSheetId, names }`; selection and editing state are not part of it.
113
+
114
+ | Tool | Use |
115
+ | --- | --- |
116
+ | `get_spreadsheet_document` | Take a copy of the whole workbook as `{ kind, formatVersion, revision, document }` before a risky rewrite, or to hand it on. To read the workbook, use `get_range`: it is smaller and says more. Refuses very large documents. |
117
+ | `load_spreadsheet_document` | Put back a copy from `get_spreadsheet_document` (its `document`, or the whole result). Checked first: when anything is wrong nothing changes and the error says what. One undo step (`undo_spreadsheet` brings the previous workbook back). To change cells use `set_range` or `set_cell`. |
118
+ | `undo_spreadsheet` | Undo the last workbook edit (one tool call or one user gesture). Returns `undone` (the step's name, when it has one) and whether more can be undone. Fails with "Nothing to undo." when there is nothing. |
119
+ | `redo_spreadsheet` | Redo the last undone workbook edit. |
120
+ | `save_spreadsheet_document` | Save the workbook under a `name` in the host's storage (the same name replaces that copy). Returns the `key`. Only listed when the host has storage. Save when the user asks, not after every edit. |
121
+ | `list_saved_spreadsheet_documents` | List saved workbooks (`key`, `name`, `savedAt`), newest first. |
122
+ | `open_saved_spreadsheet_document` | Replace the workbook with a saved one by `key`. One undo step. Ask before opening over changes the user has not saved. |
123
+
110
124
  ## Commands
111
125
 
112
126
  Run with `run_command` when the host registers them. Merge, unmerge and transpose act on the
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: pixerate-tokens
3
+ description: How to read and change Pixerate design tokens (collections of variables with a value per mode, such as Light and Dark, and aliases between variables) through the shared document tools - getting the whole token set, editing collections, modes, variables and aliases, loading it back as one undo step, undo and redo, and saving or opening named token sets. Use when token tools (get_tokens_document, load_tokens_document...) are available or the user asks to change design tokens, theme colours, spacing scales or light / dark modes.
4
+ ---
5
+
6
+ # Design tokens
7
+
8
+ A token set holds **collections** (for example "Colours" or "Spacing"), each with one or more
9
+ **modes** ("Light" and "Dark", or "Mobile" and "Desktop"), and **variables** (`color`,
10
+ `number`, `string` or `boolean`) with a value for each mode of their collection. A value can be
11
+ an alias to another variable, so `button/background` can point at `brand/primary` and follow it.
12
+ Hosts turn the set into CSS variables per mode (`exportTokensCss`) and W3C design-token JSON.
13
+
14
+ There are no per-variable tools yet: read the whole set with `get_tokens_document`, change the
15
+ JSON, and write it back with `load_tokens_document`. Read `pixerate-agent-tools` first for tool
16
+ naming and errors.
17
+
18
+ ## Working method
19
+
20
+ 1. **Read.** `get_tokens_document`. Note collection, mode and variable ids: values are keyed by
21
+ mode id, and aliases name variable ids.
22
+ 2. **Change the copy.** Keep every id you are not deliberately removing. New ids must be unique
23
+ strings. Give every variable a value for every mode of its collection.
24
+ 3. **Write once.** `load_tokens_document` with the whole edited document. It is checked first: a
25
+ variable in a missing collection, a value for a missing mode or a broken alias is refused and
26
+ nothing changes. One load is one undo step.
27
+ 4. **Check.** Read the result's `revision`; if it did not change, nothing was different.
28
+
29
+ ## Best practices
30
+
31
+ - Name variables by role, not value: `text/primary`, not `grey-900`. Use `/` for groups.
32
+ - Put raw values in one primitives collection and point role variables at them with aliases,
33
+ so a theme change touches one place.
34
+ - Keep modes for real alternatives (Light / Dark). Do not make a mode per brand colour.
35
+ - Do not alias a variable to itself or in a cycle.
36
+
37
+ ## Save and open
38
+
39
+ The host may add the shared document tools (see `pixerate-agent-tools`). A tokens document is the whole `TokenState`: `{ collections: [{ id, name, modes: [{ id, name }] }], variables: [{ id, collectionId, name, type, valuesByMode }] }`. A value is a literal for its type (`"#rrggbb"` colours, numbers, strings, booleans) or an alias `{ "alias": "<variable id>" }`.
40
+
41
+ | Tool | Use |
42
+ | --- | --- |
43
+ | `get_tokens_document` | Take a copy of the whole token set as `{ kind, formatVersion, revision, document }` before a risky rewrite, or to hand it on. To read the token set, use `get_tokens_document`: it is smaller and says more. Refuses very large documents. |
44
+ | `load_tokens_document` | Put back a copy from `get_tokens_document` (its `document`, or the whole result). Checked first: when anything is wrong nothing changes and the error says what. One undo step (`undo_tokens` brings the previous token set back). Use it for every change: read the document, edit the JSON, load it back. |
45
+ | `undo_tokens` | Undo the last token set edit (one tool call or one user gesture). Returns `undone` (the step's name, when it has one) and whether more can be undone. Fails with "Nothing to undo." when there is nothing. |
46
+ | `redo_tokens` | Redo the last undone token set edit. |
47
+ | `save_tokens_document` | Save the token set under a `name` in the host's storage (the same name replaces that copy). Returns the `key`. Only listed when the host has storage. Save when the user asks, not after every edit. |
48
+ | `list_saved_tokens_documents` | List saved token sets (`key`, `name`, `savedAt`), newest first. |
49
+ | `open_saved_tokens_document` | Replace the token set with a saved one by `key`. One undo step. Ask before opening over changes the user has not saved. |
50
+
51
+ ## Pitfalls
52
+
53
+ - Removing a variable that others alias leaves broken aliases: point them elsewhere in the same
54
+ load.
55
+ - `load_tokens_document` replaces everything. Do not send a partial document: missing
56
+ collections and variables are deleted.