@openpresentation/opf 0.6.0 → 0.8.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.
@@ -1,4 +1,4 @@
1
- import { a as SchemaName } from './schemas-C1DxapX2.js';
1
+ import { a as SchemaName } from './schemas--QRVBhU1.js';
2
2
 
3
3
  /**
4
4
  * Schema for audience records in the pptx.gallery library. Each record names an audience archetype (e.g. 'executives', 'engineering-team', 'investors') and carries seniority, technical-fluency, decision-power, and attention-budget hints used by AI-driven generation. Audiences are referenced from OPF documents via audience; the engine resolves the reference against catalogs.audiences (inline) → catalogs.audiences.source → the default catalog at https://www.pptx.gallery/audiences. The audience field also accepts free-form strings; this catalog is for engine-aware audience archetypes that carry generation hints.
@@ -1,2 +1,2 @@
1
- export { C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-x1oFFQnd.js';
2
- import './schemas-C1DxapX2.js';
1
+ export { C as CatalogEntry, a as CatalogIndex, b as CatalogIndexRecord, c as CatalogKind, d as CatalogRecord, i as audiences, j as catalogEntries, k as catalogIndexes, l as catalogKinds, m as catalogSchemaNames, n as catalogs, o as chartTypes, p as colorSchemes, q as fontSchemes, r as languages, s as layouts, t as narratives, u as purposes, v as socialPlatforms, w as themes, x as tones } from './catalogs-BnnkUX9O.js';
2
+ import './schemas--QRVBhU1.js';
@@ -3688,10 +3688,16 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
3688
3688
  "items": {
3689
3689
  "$ref": "#/$defs/TextRun"
3690
3690
  }
3691
+ },
3692
+ {
3693
+ "$ref": "#/$defs/StyledTableCell"
3694
+ },
3695
+ {
3696
+ "type": "null"
3691
3697
  }
3692
3698
  ]
3693
3699
  },
3694
- "description": "Optional column labels rendered above table rows. Each label is a string or an array of TextRun values for inline formatting.",
3700
+ "description": "Optional column labels. Labels may be strings, rich runs or styled cell objects. Null is an empty label or a placeholder covered by a preceding column span.",
3695
3701
  "examples": [
3696
3702
  [
3697
3703
  "Region",
@@ -3862,6 +3868,17 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
3862
3868
  "description": "A cell in inline chart data."
3863
3869
  },
3864
3870
  "TableCell": {
3871
+ "oneOf": [
3872
+ {
3873
+ "$ref": "#/$defs/TableCellValue"
3874
+ },
3875
+ {
3876
+ "$ref": "#/$defs/StyledTableCell"
3877
+ }
3878
+ ],
3879
+ "description": "A scalar, rich-run array, or styled/spanning cell object. Existing scalar and rich forms remain valid."
3880
+ },
3881
+ "TableCellValue": {
3865
3882
  "oneOf": [
3866
3883
  {
3867
3884
  "type": "string"
@@ -3882,7 +3899,149 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
3882
3899
  }
3883
3900
  }
3884
3901
  ],
3885
- "description": "A cell in table content. Scalar values keep their text representation; TextRun arrays preserve inline formatting and use mixed-style text measurement."
3902
+ "description": "A scalar table value or canonical rich text runs, without cell decoration or geometry."
3903
+ },
3904
+ "StyledTableCell": {
3905
+ "type": "object",
3906
+ "additionalProperties": false,
3907
+ "required": [
3908
+ "value"
3909
+ ],
3910
+ "properties": {
3911
+ "value": {
3912
+ "$ref": "#/$defs/TableCellValue",
3913
+ "description": "Editable cell content; styling and spans do not change its scalar type or rich runs."
3914
+ },
3915
+ "style": {
3916
+ "$ref": "#/$defs/TableCellStyle"
3917
+ },
3918
+ "colSpan": {
3919
+ "type": "integer",
3920
+ "minimum": 1,
3921
+ "description": "Number of grid columns covered, starting at this cell. Covered positions must contain null. Default 1."
3922
+ },
3923
+ "rowSpan": {
3924
+ "type": "integer",
3925
+ "minimum": 1,
3926
+ "description": "Number of grid rows covered, starting at this cell. Covered positions must contain null. Header cells cannot span into body rows. Default 1."
3927
+ }
3928
+ },
3929
+ "description": "A cell with explicit visual style or merged geometry. Its position remains its array column index; use null placeholders for every covered grid position."
3930
+ },
3931
+ "TableCellStyle": {
3932
+ "type": "object",
3933
+ "additionalProperties": false,
3934
+ "properties": {
3935
+ "fill": {
3936
+ "type": "string",
3937
+ "pattern": "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
3938
+ "description": "Explicit RGB or RGBA color. Eight-digit colors include alpha; #00000000 is transparent."
3939
+ },
3940
+ "color": {
3941
+ "type": "string",
3942
+ "pattern": "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
3943
+ "description": "Default text color, overridden by individual rich run colors."
3944
+ },
3945
+ "align": {
3946
+ "type": "string",
3947
+ "enum": [
3948
+ "left",
3949
+ "center",
3950
+ "right"
3951
+ ],
3952
+ "description": "Horizontal text alignment inside the cell."
3953
+ },
3954
+ "verticalAlign": {
3955
+ "type": "string",
3956
+ "enum": [
3957
+ "top",
3958
+ "middle",
3959
+ "bottom"
3960
+ ],
3961
+ "description": "Vertical alignment inside the padded cell box."
3962
+ },
3963
+ "padding": {
3964
+ "$ref": "#/$defs/TableCellPadding"
3965
+ },
3966
+ "borders": {
3967
+ "type": "object",
3968
+ "additionalProperties": false,
3969
+ "properties": {
3970
+ "top": {
3971
+ "$ref": "#/$defs/TableCellBorder"
3972
+ },
3973
+ "right": {
3974
+ "$ref": "#/$defs/TableCellBorder"
3975
+ },
3976
+ "bottom": {
3977
+ "$ref": "#/$defs/TableCellBorder"
3978
+ },
3979
+ "left": {
3980
+ "$ref": "#/$defs/TableCellBorder"
3981
+ }
3982
+ },
3983
+ "description": "Independent cell edges. Omitted edges retain the table theme border; width 0 removes an edge."
3984
+ }
3985
+ },
3986
+ "description": "Cell appearance. Sizes use reference pixels at a 720-pixel canvas short edge and scale with the slide."
3987
+ },
3988
+ "TableCellPadding": {
3989
+ "type": "object",
3990
+ "additionalProperties": false,
3991
+ "properties": {
3992
+ "top": {
3993
+ "type": "number",
3994
+ "minimum": 0,
3995
+ "maximum": 200
3996
+ },
3997
+ "right": {
3998
+ "type": "number",
3999
+ "minimum": 0,
4000
+ "maximum": 200
4001
+ },
4002
+ "bottom": {
4003
+ "type": "number",
4004
+ "minimum": 0,
4005
+ "maximum": 200
4006
+ },
4007
+ "left": {
4008
+ "type": "number",
4009
+ "minimum": 0,
4010
+ "maximum": 200
4011
+ }
4012
+ },
4013
+ "description": "Text insets in reference pixels. Defaults: top 8, right 10, bottom 4, left 10."
4014
+ },
4015
+ "TableCellBorder": {
4016
+ "type": "object",
4017
+ "additionalProperties": false,
4018
+ "required": [
4019
+ "color",
4020
+ "width"
4021
+ ],
4022
+ "properties": {
4023
+ "color": {
4024
+ "type": "string",
4025
+ "pattern": "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
4026
+ "description": "Explicit RGB or RGBA color. Eight-digit colors include alpha; #00000000 is transparent."
4027
+ },
4028
+ "width": {
4029
+ "type": "number",
4030
+ "minimum": 0,
4031
+ "maximum": 32,
4032
+ "description": "Border width in reference pixels; 0 removes this edge."
4033
+ },
4034
+ "dash": {
4035
+ "type": "string",
4036
+ "enum": [
4037
+ "solid",
4038
+ "dash",
4039
+ "dot"
4040
+ ],
4041
+ "description": "Default solid."
4042
+ }
4043
+ },
4044
+ "description": "One explicit cell border."
3886
4045
  },
3887
4046
  "Catalogs": {
3888
4047
  "type": "object",
@@ -1,5 +1,5 @@
1
- import { MAX_COMPOSITION_DEPTH } from './chunk-C7GKRLI6.js';
2
- import { schemas } from './chunk-KSN6RQG2.js';
1
+ import { MAX_COMPOSITION_DEPTH, tableGrid } from './chunk-NEQAPMS2.js';
2
+ import { schemas } from './chunk-GQSK3T7X.js';
3
3
  import { catalogSchemaNames } from './chunk-TWMRZ43O.js';
4
4
  import Ajv2020 from 'ajv/dist/2020.js';
5
5
  import addFormats from 'ajv-formats';
@@ -802,6 +802,14 @@ function validatePresentationSemantics(value) {
802
802
  slideIds.add(slide.id);
803
803
  }
804
804
  issues.push(...validateSlideRegions(slide, `/slides/${index}`));
805
+ const visitTables = (node, path) => {
806
+ if (isRecord(node.table)) for (const issue of tableGrid(node.table).issues) issues.push(semanticIssue(pathFor(path, "table") + issue.path.slice(5).replaceAll(".", "/"), issue.message));
807
+ if (Array.isArray(node.blocks)) node.blocks.forEach((block, i) => {
808
+ if (isRecord(block)) visitTables(block, `${path}/blocks/${i}`);
809
+ });
810
+ for (const key of promotedRegionKeys) if (isRecord(node[key])) visitTables(node[key], pathFor(path, key));
811
+ };
812
+ visitTables(slide, `/slides/${index}`);
805
813
  }
806
814
  });
807
815
  return issues;