@a3s-lab/office 0.43.0 → 0.44.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 (39) hide show
  1. package/README.md +18 -1
  2. package/dist/0~1403.js +1 -1
  3. package/dist/0~2330.js +1 -1
  4. package/dist/0~3539.js +2 -2
  5. package/dist/0~3557.js +1 -1
  6. package/dist/0~4980.js +1 -1
  7. package/dist/0~5024.js +1 -1
  8. package/dist/0~7828.js +1 -1
  9. package/dist/{0~7048.js → 0~7831.js} +2 -547
  10. package/dist/0~document-editor.js +4 -3
  11. package/dist/{0~3635.js → 0~office-color-picker.js} +1 -12
  12. package/dist/0~pdf-viewer.js +22 -8
  13. package/dist/0~presentation-editor.js +4 -3
  14. package/dist/0~spreadsheet-editor.js +200 -3669
  15. package/dist/0~work-docx-export.js +1 -1
  16. package/dist/0~work-docx-import.js +1 -1
  17. package/dist/0~work-office-diagnostics.js +1 -1
  18. package/dist/0~work-pptx-export.js +1 -1
  19. package/dist/0~work-pptx-import.js +1 -1
  20. package/dist/0~work-presentation-charts.js +1 -1
  21. package/dist/3818.js +1 -1
  22. package/dist/4166.js +1 -1
  23. package/dist/4174.js +3 -3
  24. package/dist/4560.js +2 -2
  25. package/dist/{5416.js → 610.js} +4335 -410
  26. package/dist/{4121.js → 6968.js} +622 -13
  27. package/dist/7060.js +1 -1
  28. package/dist/{4650.js → 816.js} +12 -1
  29. package/dist/8715.js +1 -1
  30. package/dist/9333.js +17 -17
  31. package/dist/core.js +7 -5
  32. package/dist/index.js +2 -2
  33. package/dist/internal/features/work/editors/spreadsheet-data-validation-list.d.ts +44 -0
  34. package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +2 -1
  35. package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +1 -1
  36. package/dist/internal/features/work/work-types.d.ts +4 -0
  37. package/dist/office-kernel.wasm +0 -0
  38. package/dist/styles.css +13 -1
  39. package/package.json +1 -1
package/dist/7060.js CHANGED
@@ -1,4 +1,4 @@
1
- import { workOfficeCollaborationJsonEqual, isWorkOfficeCollaborationRecord, cloneWorkOfficeCollaborationJson } from "./4650.js";
1
+ import { workOfficeCollaborationJsonEqual, isWorkOfficeCollaborationRecord, cloneWorkOfficeCollaborationJson } from "./816.js";
2
2
  import { OfficeCollaborationError as WorkOfficeCollaborationError } from "./9787.js";
3
3
  import * as __rspack_external_yjs from "yjs";
4
4
  function patchWorkOfficeCollaborationFlatJsonMap(target, previous, next, label) {
@@ -67,4 +67,15 @@ function isUnsafeJsonKey(key) {
67
67
  function invalidCollaborationJson(expected) {
68
68
  throw new WorkOfficeCollaborationError('office.collaboration.content_invalid', `Office collaboration requires ${expected}.`);
69
69
  }
70
- export { canonicalWorkOfficeCollaborationJson, cloneWorkOfficeCollaborationJson, isWorkOfficeCollaborationRecord, workOfficeCollaborationJsonEqual };
70
+ const MODAL_DIALOG_SELECTOR = '[role="dialog"][aria-modal="true"]';
71
+ const OFFICE_SHORTCUT_IGNORE_SELECTOR = '[data-office-shortcuts="ignore"]';
72
+ function isOfficeCompositionKeyboardEvent(event) {
73
+ return event.isComposing || 'Process' === event.key || 229 === event.keyCode;
74
+ }
75
+ function isOfficeShortcutBlocked(target) {
76
+ if ("u" < typeof document) return false;
77
+ if (target instanceof Element && (target.closest(MODAL_DIALOG_SELECTOR) || target.closest(OFFICE_SHORTCUT_IGNORE_SELECTOR))) return true;
78
+ if (document.activeElement instanceof Element && (document.activeElement.closest(MODAL_DIALOG_SELECTOR) || document.activeElement.closest(OFFICE_SHORTCUT_IGNORE_SELECTOR))) return true;
79
+ return null !== document.querySelector(MODAL_DIALOG_SELECTOR);
80
+ }
81
+ export { canonicalWorkOfficeCollaborationJson, cloneWorkOfficeCollaborationJson, isOfficeCompositionKeyboardEvent, isOfficeShortcutBlocked, isWorkOfficeCollaborationRecord, workOfficeCollaborationJsonEqual };
package/dist/8715.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createOfficeId as createWorkId, directChild, attribute } from "./4121.js";
1
+ import { createOfficeId as createWorkId, directChild, attribute } from "./6968.js";
2
2
  function sparseArrayIndexes(values) {
3
3
  if (!values) return [];
4
4
  return Object.keys(values).flatMap((key)=>{
package/dist/9333.js CHANGED
@@ -1,4 +1,4 @@
1
- import { directChild, directChildren, attribute, firstDescendant } from "./4121.js";
1
+ import { directChild, directChildren, attribute, firstDescendant } from "./6968.js";
2
2
  import { sparseMatrixColumnCount, cloneSparseMatrix, sparseArrayIndexes, sparseArrayEntries as spreadsheet_sparse_sparseArrayEntries, formatSpreadsheetCellRanges, parseSpreadsheetCellRanges as work_spreadsheet_ranges_parseSpreadsheetCellRanges } from "./8715.js";
3
3
  function* xlsxWorksheetCellEntries(worksheet) {
4
4
  if (Array.isArray(worksheet)) {
@@ -1353,22 +1353,6 @@ function stringRecord(value) {
1353
1353
  const entries = Object.entries(value).filter((entry)=>'string' == typeof entry[1]);
1354
1354
  return entries.length ? Object.fromEntries(entries) : void 0;
1355
1355
  }
1356
- const SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS = [
1357
- 'greaterThan',
1358
- 'greaterThanOrEqual',
1359
- 'lessThan',
1360
- 'lessThanOrEqual',
1361
- 'equal',
1362
- 'notEqual',
1363
- 'between',
1364
- 'notBetween'
1365
- ];
1366
- function isSpreadsheetConditionalComparisonOperator(value) {
1367
- return SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS.some((operator)=>operator === value);
1368
- }
1369
- function spreadsheetConditionalComparisonNeedsUpperValue(operator) {
1370
- return 'between' === operator || 'notBetween' === operator;
1371
- }
1372
1356
  const DEFAULT_DATA_BAR_MIN_LENGTH = 10;
1373
1357
  const DEFAULT_DATA_BAR_MAX_LENGTH = 90;
1374
1358
  function defaultSpreadsheetColorScaleThresholds(colorCount) {
@@ -1758,6 +1742,22 @@ function work_spreadsheet_conditional_icons_palette(count) {
1758
1742
  if (4 === count) return COLOR_4;
1759
1743
  return COLOR_5;
1760
1744
  }
1745
+ const SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS = [
1746
+ 'greaterThan',
1747
+ 'greaterThanOrEqual',
1748
+ 'lessThan',
1749
+ 'lessThanOrEqual',
1750
+ 'equal',
1751
+ 'notEqual',
1752
+ 'between',
1753
+ 'notBetween'
1754
+ ];
1755
+ function isSpreadsheetConditionalComparisonOperator(value) {
1756
+ return SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS.some((operator)=>operator === value);
1757
+ }
1758
+ function spreadsheetConditionalComparisonNeedsUpperValue(operator) {
1759
+ return 'between' === operator || 'notBetween' === operator;
1760
+ }
1761
1761
  function effectiveSpreadsheetHeaderFooterSections(sections) {
1762
1762
  return {
1763
1763
  left: sections?.left ?? '',
package/dist/core.js CHANGED
@@ -2,10 +2,10 @@ import jszip from "jszip";
2
2
  import { MarkdownManager } from "@tiptap/markdown";
3
3
  import { getSchema } from "@tiptap/core";
4
4
  import { OFFICE_COLLABORATION_PROTOCOL as WORK_OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError as WorkOfficeCollaborationError, assertWorkOfficeCollaborationOrigin } from "./9787.js";
5
- import { directChildren, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, directChild, descendants, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./4121.js";
5
+ import { directChildren, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, directChild, descendants, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./6968.js";
6
6
  import { fileNameWithoutExtension, work_file_download_downloadBlob, mountWorkLiveDocumentCapture, importWorkDocumentFile, moveWorkSourceBlob, materializeWorkDocumentContent as work_document_model_codec_materializeWorkDocumentContent, createWorkDocumentModel, work_file_download_safeFileName, documentPageSurfaceGeometryForElement, registerSourceBlob as rememberWorkSourceBlob, documentModelForContent, readSourceBlob as readWorkSourceBlob, createWorkDocumentExtensions, positionWorkLiveDocumentCapture, createWorkDocumentBlob } from "./4174.js";
7
7
  import { normalizeSpreadsheetPrintTitleRows, sparseMatrixColumnCount, normalizeSpreadsheetPrintArea, parseSpreadsheetPrintTitles, isValidSpreadsheetDefinedName, formatSpreadsheetCellRanges, stripSpreadsheetSheetQualifier, editableSpreadsheetFormula, sparseArrayEntries, qualifySpreadsheetRange, refreshSpreadsheetPivotTables, parseSpreadsheetCellRanges, normalizeSpreadsheetPrintTitleColumns } from "./8715.js";
8
- import { xlsxColorMatches, xlsxRichTextCellText, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextStyleOrigins, normalizeSpreadsheetDataValidationErrorStyle, workSpreadsheetAutoFilterCriteriaEntries, directXlsxAlignment, spreadsheetTableTotalsFunctionToOoxml, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, hasXlsxDirectFontStyle, applyImportedXlsxRichText, xlsxStyleCollectionIndex, sheetHasXlsxRichTextCells, spreadsheetExplicitTextOrientationFromCell, activeXlsxNativeFill, workSpreadsheetHasUnescapedWildcard, readXlsxRichTextCells, createXlsxRichTextReadContext, normalizeSpreadsheetDateValidationBoundary, boundedSpreadsheetDataValidationText, xlsxNativeFillKey, xlsxBooleanAttribute, xlsxAlignmentMatches, xlsxBorderLineMatches, spreadsheetTextOrientationCellStyle, spreadsheetTableTotalsFunctionFromOoxml, spreadsheetDateValidationFormula, spreadsheetDiagonalBorderFromCellValue, workSpreadsheetSheetWithImportedAutoFilterCriteria, xlsxUnderlineStyle, spreadsheetUnderlineCellValueFromXlsx, xlsxToggleEnabled, normalizeSpreadsheetTableTotalsLabel, activeXlsxSemanticColorOrigin, writeXlsxRichTextCells, xlsxNativeFillSemanticColors, normalizeSpreadsheetTableCalculatedFormula, normalizeSpreadsheetTableTotalsFormula, spreadsheetUnderlineCellValueFromSheetJs } from "./5416.js";
8
+ import { xlsxColorMatches, xlsxRichTextCellText, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextStyleOrigins, normalizeSpreadsheetDataValidationErrorStyle, workSpreadsheetAutoFilterCriteriaEntries, directXlsxAlignment, spreadsheetTableTotalsFunctionToOoxml, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, hasXlsxDirectFontStyle, applyImportedXlsxRichText, xlsxStyleCollectionIndex, sheetHasXlsxRichTextCells, spreadsheetExplicitTextOrientationFromCell, activeXlsxNativeFill, workSpreadsheetHasUnescapedWildcard, readXlsxRichTextCells, createXlsxRichTextReadContext, normalizeSpreadsheetDateValidationBoundary, boundedSpreadsheetDataValidationText, xlsxNativeFillKey, xlsxBooleanAttribute, xlsxAlignmentMatches, xlsxBorderLineMatches, spreadsheetTextOrientationCellStyle, spreadsheetTableTotalsFunctionFromOoxml, spreadsheetDateValidationFormula, isSpreadsheetDependentListFormula, spreadsheetDiagonalBorderFromCellValue, workSpreadsheetSheetWithImportedAutoFilterCriteria, xlsxUnderlineStyle, spreadsheetUnderlineCellValueFromXlsx, xlsxToggleEnabled, normalizeSpreadsheetTableTotalsLabel, activeXlsxSemanticColorOrigin, writeXlsxRichTextCells, xlsxNativeFillSemanticColors, normalizeSpreadsheetTableCalculatedFormula, normalizeSpreadsheetTableTotalsFormula, spreadsheetUnderlineCellValueFromSheetJs } from "./610.js";
9
9
  import { freezeImportedSpreadsheetCell, readXlsxGradientFill, withXlsxPatternFill, xlsxCellStyleOriginSemanticColors, setXlsxToggleChild, withXlsxCellStyleOrigin, normalizeSpreadsheetConditionalVisualOptions, xlsxColorElementMatchesOrigin, withXlsxGradientFill, ensureXlsxStyleCollection, xlsxCellStyleOrigin, xlsxSemanticColorOriginKey, readXlsxPatternFill, isSpreadsheetConditionalComparisonOperator, registerImportedSpreadsheetMatrix, defaultSpreadsheetConditionalIconThresholds, readXlsxSemanticColorOrigin, setXlsxUnderlineChild, xlsxGradientFillFallbackColor, setXlsxColorChild, createXlsxColorResolver, resolveXlsxColor, setXlsxBorderLine, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, defaultXlsxBorder, prepareXlsxSemanticPalette, importedSheetProtectionAuthority, defaultSpreadsheetColorScaleThresholds, xlsxRgbColor, writeXlsxAlignment, xlsxGradientFillKey, applyXlsxSemanticColorOrigin, spreadsheetConditionalComparisonNeedsUpperValue, sheetHasProtectionState, xlsxWorksheetCellEntries, isSpreadsheetConditionalIconSetName, setXlsxValueChild, defaultXlsxFill, spreadsheetConditionalThresholdsEqual, spreadsheetConditionalIconSetCount } from "./9333.js";
10
10
  import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, readXlsxWorksheetCharts, createXlsxFormulaCell, patchXlsxWorksheetDrawings, readXlsxWorksheetImages, writeXlsxProtection, xlsxWorksheetChartsToSheet, readXlsxFormulaFeaturesFromPackage, emptySpreadsheetWorksheetCompatibilitySummary, createSpreadsheetFormulaMetadata, createXlsxErrorCell, xlsxWorksheetImagesToSheet, readXlsxProtection, patchXlsxFormulaFeatures, patchXlsxPivotTables, writeXlsxPageSetup, XlsxCellProtectionWriter, applyImportedXlsxPivotTables, readXlsxPageSetup } from "./4166.js";
11
11
  import { WorkFileImportController, materializeWorkFileSource } from "./9356.js";
@@ -3316,12 +3316,14 @@ function xlsxValidationFormula(item, source, namedListSources) {
3316
3316
  if ('date' === item.type) return spreadsheetDateValidationFormula(value);
3317
3317
  if ('dropdown' !== item.type) return value;
3318
3318
  const formula = value.replace(/^=/, '');
3319
+ if (isSpreadsheetDependentListFormula(value)) return formula;
3319
3320
  if (/^=?[^,]+![A-Z]+\d+(?::[A-Z]+\d+)?$/i.test(value) || /^=?\$?[A-Z]+\$?\d+(?::\$?[A-Z]+\$?\d+)?$/i.test(value) || namedListSources.has(formula.toLocaleLowerCase())) return formula;
3320
3321
  return `"${value.replaceAll('"', '""')}"`;
3321
3322
  }
3322
3323
  function parseListFormula(value) {
3323
3324
  if (value.startsWith('"') && value.endsWith('"')) return value.slice(1, -1).replaceAll('""', '"');
3324
- return value.replace(/^=/, '');
3325
+ const formula = value.replace(/^=/, '');
3326
+ return isSpreadsheetDependentListFormula(formula) ? `=${formula}` : formula;
3325
3327
  }
3326
3328
  function fortuneValidationType(value) {
3327
3329
  const types = {
@@ -5427,10 +5429,10 @@ function work_pdf_export_safeFileName(value) {
5427
5429
  }
5428
5430
  var core_OFFICE_COLLABORATION_VERSION = 1;
5429
5431
  export { AGENT_PROPOSAL_PROTOCOL, OFFICE_NOTIFICATION_EVENT, createAgentProposalInstruction, createAgentProposalRequest, getAgentProposalStatus, subscribeOfficeNotifications } from "./6489.js";
5430
- export { DEFAULT_SPREADSHEET_SORT_CUSTOM_LIST_STORAGE_KEY, LocalStorageSpreadsheetSortCustomListStore, createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./5416.js";
5432
+ export { DEFAULT_SPREADSHEET_SORT_CUSTOM_LIST_STORAGE_KEY, LocalStorageSpreadsheetSortCustomListStore, createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./610.js";
5431
5433
  export { OFFICE_COLLABORATION_NAMESPACE, OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError, createOfficeCollaborationSession, readOfficeCollaborationMetadata } from "./9787.js";
5432
5434
  export { assertPdfCollaborationSource, createOfficePdfCollaborationBinding, initializeOfficePdfCollaboration, readOfficePdfCollaboration, readOfficePdfCollaborationSource, replaceOfficePdfCollaboration } from "./3818.js";
5433
- export { createArtifact, createOfficeId, officeTemplates } from "./4121.js";
5435
+ export { createArtifact, createOfficeId, officeTemplates } from "./6968.js";
5434
5436
  export { createOfficeDocumentCollaborationBinding, forgetSourceBlob, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration, readSourceBlob, registerSourceBlob } from "./4174.js";
5435
5437
  export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
5436
5438
  export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
package/dist/index.js CHANGED
@@ -2,12 +2,12 @@ var src_DOCUMENT_SNAPSHOT_VERSION = 1;
2
2
  var src_DOCUMENT_SOURCE_VERSION = 1;
3
3
  var src_OFFICE_COLLABORATION_VERSION = 1;
4
4
  export { AGENT_PROPOSAL_PROTOCOL, OFFICE_NOTIFICATION_EVENT, createAgentProposalInstruction, createAgentProposalRequest, getAgentProposalStatus, subscribeOfficeNotifications } from "./6489.js";
5
- export { DEFAULT_SPREADSHEET_SORT_CUSTOM_LIST_STORAGE_KEY, LocalStorageSpreadsheetSortCustomListStore, createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./5416.js";
5
+ export { DEFAULT_SPREADSHEET_SORT_CUSTOM_LIST_STORAGE_KEY, LocalStorageSpreadsheetSortCustomListStore, createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./610.js";
6
6
  export { DOCUMENT_SNAPSHOT_MEDIA_TYPE, DOCUMENT_SNAPSHOT_SCHEMA, DOCUMENT_SOURCE_MEDIA_TYPE, DOCUMENT_SOURCE_SCHEMA, OFFICE_COLLABORATION_DEFAULT_MAX_TRANSPORT_PAYLOAD_BYTES, OFFICE_COLLABORATION_MAX_TRANSPORT_PAYLOAD_BYTES, OFFICE_COLLABORATION_PRESENCE_FIELD, OFFICE_FILE_ACCEPT, applyDocumentSource, artifactExtension, artifactExtension as workArtifactExtension, artifactKindLabel, artifactKindLabel as workArtifactKindLabel, createArtifactBlob, createOfficeCollaborationPresence, createOfficeCollaborationTransportBinding, createPdfCollaborationContent, decodeDocumentSnapshot, defaultPptxRuntimeUrl, downloadArtifact, downloadArtifactPdf, encodeDocumentSnapshot, importOfficeFile, officeKindForFile, pdfPagesForExport, projectDocumentSource } from "./core.js";
7
7
  export { DocumentEditor, MarkdownEditor, PDF_EVIDENCE_COORDINATE_BASIS, PdfViewer, PresentationEditor, SpreadsheetEditor, defaultDocumentArabicLayoutFontUrl, defaultDocumentHebrewLayoutFontUrl, defaultDocumentLatinLayoutFontUrl, defaultDocumentLayoutFontUrl, defaultDocumentLayoutFonts, defaultOfficeKernelWasmUrl, defaultPdfiumWasmUrl, preloadOfficeEditor } from "./432.js";
8
8
  export { OFFICE_COLLABORATION_NAMESPACE, OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError, createOfficeCollaborationSession, readOfficeCollaborationMetadata } from "./9787.js";
9
9
  export { assertPdfCollaborationSource, createOfficePdfCollaborationBinding, initializeOfficePdfCollaboration, readOfficePdfCollaboration, readOfficePdfCollaborationSource, replaceOfficePdfCollaboration } from "./3818.js";
10
- export { createArtifact, createOfficeId, officeTemplates } from "./4121.js";
10
+ export { createArtifact, createOfficeId, officeTemplates } from "./6968.js";
11
11
  export { createOfficeDocumentCollaborationBinding, forgetSourceBlob, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration, readSourceBlob, registerSourceBlob } from "./4174.js";
12
12
  export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
13
13
  export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
@@ -0,0 +1,44 @@
1
+ import type { WorkSpreadsheetContent, WorkSpreadsheetSheet } from '../work-types';
2
+ /** Keep dependent-list parsing synchronous and bounded at the editor boundary. */
3
+ export declare const MAX_SPREADSHEET_DEPENDENT_LIST_FORMULA_LENGTH = 255;
4
+ export declare const MAX_SPREADSHEET_DEPENDENT_LIST_REFERENCE_CELLS = 1024;
5
+ export declare const MAX_SPREADSHEET_DEPENDENT_LIST_MATERIALIZED_CELLS = 10000;
6
+ export interface SpreadsheetDependentListFormulaResult {
7
+ ok: boolean;
8
+ formula?: string;
9
+ message?: string;
10
+ }
11
+ export interface SpreadsheetDependentListReferenceResult {
12
+ ok: boolean;
13
+ empty?: boolean;
14
+ displayReference?: string;
15
+ message?: string;
16
+ }
17
+ /**
18
+ * Returns true for the deliberately small, local dependent-list grammar.
19
+ *
20
+ * The leading `=` is optional when reading an existing workbook, but authoring
21
+ * always writes it back so a formula cannot be confused with a literal list.
22
+ */
23
+ export declare function isSpreadsheetDependentListFormula(value: unknown): boolean;
24
+ /**
25
+ * Normalize an INDIRECT list source without evaluating workbook state.
26
+ * Supported arguments are quoted text, a single-cell reference, or a bounded
27
+ * `&` concatenation of those terms. Nested functions and external books are
28
+ * intentionally rejected at the local editor boundary.
29
+ */
30
+ export declare function normalizeSpreadsheetDependentListFormula(value: string): SpreadsheetDependentListFormulaResult;
31
+ /**
32
+ * Resolve one dependent list for a target cell. An empty driver cell is a
33
+ * valid state and produces an empty list; malformed non-empty references fail
34
+ * closed so the editor never silently offers the wrong options.
35
+ */
36
+ export declare function resolveSpreadsheetDependentListReference(content: WorkSpreadsheetContent, sheetId: string, row: number, column: number, anchorRow: number, anchorColumn: number, formula: string): SpreadsheetDependentListReferenceResult;
37
+ /**
38
+ * Materialize only the runtime view Fortune needs. The controlled model keeps
39
+ * the INDIRECT formula; each generated item carries a private marker so the
40
+ * projection cleanup can restore it after Fortune emits a cell operation.
41
+ */
42
+ export declare function materializeSpreadsheetDependentListsForFortune(sheets: readonly WorkSpreadsheetSheet[], namedRanges?: WorkSpreadsheetContent['namedRanges']): WorkSpreadsheetSheet[];
43
+ /** Restore controlled formulas and remove generated compact-cell overrides. */
44
+ export declare function restoreSpreadsheetDependentListProjections(sheets: readonly WorkSpreadsheetSheet[]): WorkSpreadsheetSheet[];
@@ -46,7 +46,7 @@ export type SpreadsheetDataValidationResult = {
46
46
  message: string;
47
47
  ok: false;
48
48
  };
49
- export type SpreadsheetDataValidationErrorCode = 'invalid-custom-formula' | 'invalid-date' | 'invalid-list-source' | 'invalid-number' | 'invalid-operator' | 'invalid-range' | 'invalid-text-length' | 'missing-value' | 'multiple-list-columns' | 'out-of-bounds' | 'protected-range' | 'range-too-large' | 'sheet-not-found' | 'value-order';
49
+ export type SpreadsheetDataValidationErrorCode = 'invalid-custom-formula' | 'invalid-date' | 'invalid-list-formula' | 'invalid-list-source' | 'invalid-number' | 'invalid-operator' | 'invalid-range' | 'invalid-text-length' | 'missing-value' | 'multiple-list-columns' | 'out-of-bounds' | 'protected-range' | 'range-too-large' | 'sheet-not-found' | 'value-order';
50
50
  export declare function spreadsheetDataValidationOperators(type: SpreadsheetDataValidationType): readonly SpreadsheetDataValidationOperator[];
51
51
  export declare function createSpreadsheetDataValidationDialogSource(content: WorkSpreadsheetContent, target: SpreadsheetDataValidationTarget): SpreadsheetDataValidationDialogSource | null;
52
52
  export declare function validateSpreadsheetDataValidationRequest(content: WorkSpreadsheetContent, request: SpreadsheetDataValidationRequest): SpreadsheetDataValidationResult;
@@ -54,3 +54,4 @@ export declare function applySpreadsheetDataValidation(content: WorkSpreadsheetC
54
54
  export declare function removeSpreadsheetDataValidation(content: WorkSpreadsheetContent, target: SpreadsheetDataValidationTarget): WorkSpreadsheetContent | null;
55
55
  export declare function canRemoveSpreadsheetDataValidation(content: WorkSpreadsheetContent, target: SpreadsheetDataValidationTarget): boolean;
56
56
  export declare function spreadsheetDataValidationFailureMessage(content: WorkSpreadsheetContent, request: SpreadsheetDataValidationRequest): string | null;
57
+ export declare function spreadsheetDataValidationItemAt(sheet: WorkSpreadsheetSheet, row: number, column: number): WorkSpreadsheetDataValidationItem | null;
@@ -20,7 +20,7 @@ export declare function spreadsheetFontSizeOptions(current: number | undefined):
20
20
  }[];
21
21
  export declare function spreadsheetFontFamilyOptions(current: string | undefined): OfficeSelectOption[];
22
22
  export declare function spreadsheetSheetsWithFiniteSelections(sheets: WorkSpreadsheetContent['sheets']): WorkSpreadsheetContent['sheets'];
23
- export declare function spreadsheetSheetsForFortune(sheets: WorkSpreadsheetContent['sheets']): WorkSpreadsheetContent['sheets'];
23
+ export declare function spreadsheetSheetsForFortune(sheets: WorkSpreadsheetContent['sheets'], namedRanges?: WorkSpreadsheetContent['namedRanges']): WorkSpreadsheetContent['sheets'];
24
24
  export declare function spreadsheetSheetsFromFortune(sheets: WorkSpreadsheetContent['sheets'], sourceSheets: WorkSpreadsheetContent['sheets'], operations?: readonly Op[], dateSystem?: WorkSpreadsheetDateSystem): WorkSpreadsheetContent['sheets'];
25
25
  export declare function finiteSpreadsheetSelection(selection: Selection | undefined): Selection;
26
26
  export declare function sameSpreadsheetWorkbookState(changed: WorkSpreadsheetContent['sheets'], rendered: WorkSpreadsheetContent['sheets']): boolean;
@@ -204,6 +204,10 @@ export interface WorkSpreadsheetDataValidationItem {
204
204
  type: string;
205
205
  type2: string;
206
206
  rangeTxt: string;
207
+ /**
208
+ * List values, a bounded range/name reference, or a local `=INDIRECT(...)`
209
+ * source formula for dependent dropdowns.
210
+ */
207
211
  value1: string;
208
212
  value2: string;
209
213
  validity: string;
Binary file
package/dist/styles.css CHANGED
@@ -17939,7 +17939,7 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
17939
17939
  display: grid;
17940
17940
  }
17941
17941
 
17942
- .work-spreadsheet-data-validation-custom-formula {
17942
+ .work-spreadsheet-data-validation-list-source, .work-spreadsheet-data-validation-custom-formula {
17943
17943
  gap: 8px;
17944
17944
  display: grid;
17945
17945
  }
@@ -18003,6 +18003,18 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
18003
18003
  margin-right: auto;
18004
18004
  }
18005
18005
 
18006
+ @media (width <= 900px) {
18007
+ .work-spreadsheet-canvas #luckysheet-dataVerification-dropdown-btn {
18008
+ left: calc(100% - 24px) !important;
18009
+ }
18010
+
18011
+ .work-spreadsheet-canvas #luckysheet-dataVerification-dropdown-List {
18012
+ max-width: calc(100% - 8px);
18013
+ left: auto !important;
18014
+ right: 4px !important;
18015
+ }
18016
+ }
18017
+
18006
18018
  @media (width <= 560px) {
18007
18019
  .work-spreadsheet-data-validation-condition-grid, .work-spreadsheet-data-validation-values.two, .work-spreadsheet-data-validation-behavior, .work-spreadsheet-data-validation-message-grid {
18008
18020
  grid-template-columns: minmax(0, 1fr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",