@particle-academy/dark-slide 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -138,8 +138,8 @@ interface WriteOptions {
138
138
  * and Node-only (browsers have no sync FS).
139
139
  */
140
140
 
141
- /** Feature-parity baseline with PHP dark-slide; bumped independently on npm. */
142
- declare const VERSION = "0.5.2";
141
+ /** This package's own version, pinned to package.json by `version.test.ts`. */
142
+ declare const VERSION = "0.7.2";
143
143
  type Any$4 = any;
144
144
  declare const Agent: {
145
145
  /** Validate a deck without writing. Empty array = valid. */
@@ -174,7 +174,7 @@ type Any$3 = any;
174
174
  declare class DarkSlide {
175
175
  private tempDir;
176
176
  private allowHttpImages;
177
- static readonly VERSION = "0.5.2";
177
+ static readonly VERSION = "0.7.2";
178
178
  constructor(tempDir?: string | null, allowHttpImages?: boolean);
179
179
  validate(deck: Any$3): ValidationError[];
180
180
  validateAndRepair(deck: Any$3): RepairResult;
package/dist/index.d.ts CHANGED
@@ -138,8 +138,8 @@ interface WriteOptions {
138
138
  * and Node-only (browsers have no sync FS).
139
139
  */
140
140
 
141
- /** Feature-parity baseline with PHP dark-slide; bumped independently on npm. */
142
- declare const VERSION = "0.5.2";
141
+ /** This package's own version, pinned to package.json by `version.test.ts`. */
142
+ declare const VERSION = "0.7.2";
143
143
  type Any$4 = any;
144
144
  declare const Agent: {
145
145
  /** Validate a deck without writing. Empty array = valid. */
@@ -174,7 +174,7 @@ type Any$3 = any;
174
174
  declare class DarkSlide {
175
175
  private tempDir;
176
176
  private allowHttpImages;
177
- static readonly VERSION = "0.5.2";
177
+ static readonly VERSION = "0.7.2";
178
178
  constructor(tempDir?: string | null, allowHttpImages?: boolean);
179
179
  validate(deck: Any$3): ValidationError[];
180
180
  validateAndRepair(deck: Any$3): RepairResult;
package/dist/index.js CHANGED
@@ -1343,6 +1343,49 @@ var Schema = {
1343
1343
  };
1344
1344
  }
1345
1345
  };
1346
+ function styleJsonSchema() {
1347
+ return {
1348
+ type: "object",
1349
+ description: "How a text element, or the text inside a shape, looks. The units are NOT uniform: fontSize is in design pixels and is halved into points, while letterSpacing, spaceBefore, spaceAfter, padding, radius and the border and accent-bar widths are already in points, and lineHeight is a multiple.",
1350
+ properties: {
1351
+ fontSize: { type: "number", description: "Type size in DESIGN PIXELS on the 1920px-wide fancy-slides canvas, NOT points. The PPTX file carries half, with an 8pt minimum: 96 is written as 48pt, 24 as 12pt, and anything under 16 as 8pt. Default 24." },
1352
+ fontFamily: { type: "string", description: "Typeface name. No font is embedded in the file, so where this face is not installed the viewer substitutes another, which also changes how wide the text is." },
1353
+ weight: { type: ["string", "number"], description: 'Bold when "bold" or "semibold", or a number of 600 or more. PPTX has only bold and regular, so any other weight renders regular.' },
1354
+ italic: { type: "boolean" },
1355
+ underline: { type: "boolean" },
1356
+ color: { type: "string", description: 'Text colour as a hex string. Default "#0F172A".' },
1357
+ align: { type: "string", description: 'Horizontal alignment: "left" (default), "center", "right" or "justify". Anything else renders left.' },
1358
+ verticalAlign: { type: "string", description: 'Vertical alignment inside the box: "top" (default), "middle" or "bottom".' },
1359
+ lineHeight: { type: "number", description: "Line spacing as a MULTIPLE of the type size, as in CSS: 1.4 is written as 140% line spacing." },
1360
+ letterSpacing: { type: "number", description: "Extra space between letters, in POINTS, not halved: 2 is written as 2pt." },
1361
+ spaceBefore: { type: "number", description: "Space above each paragraph, in POINTS, not halved: 6 is written as 6pt." },
1362
+ spaceAfter: { type: "number", description: "Space below each paragraph, in POINTS, not halved." },
1363
+ caps: { type: "string", description: '"small" for small capitals, or "all" (also "upper") for all capitals.' },
1364
+ bullet: { type: ["string", "boolean"], description: 'Marker for list lines ("- item"): omit for a round bullet, "none" or false for no marker, "number" for 1. 2. 3., or any other string to use it as the marker character.' },
1365
+ fill: { type: ["string", "boolean"], description: 'Background colour of the box, as a hex string. "none" or false for no fill.' },
1366
+ radius: { type: "number", description: "Corner radius of the box, in POINTS." },
1367
+ border: {
1368
+ type: "object",
1369
+ description: "An outline on all four sides of the box. PPTX cannot outline a single side; use accentBar for that.",
1370
+ properties: {
1371
+ width: { type: "number", description: "Line width in POINTS. Default 1; 0 draws no line." },
1372
+ color: { type: "string", description: 'Hex colour. Default "#CBD5E1".' },
1373
+ style: { type: "string", description: '"solid" (default), or a DrawingML dash name such as "dash" or "sysDot".' }
1374
+ }
1375
+ },
1376
+ padding: { type: ["number", "object"], description: "Inset between the box edge and the text, in POINTS: one number for every side (12 is written as 12pt), or {left, right, top, bottom}. When unset the insets are 7.2 left and right and 3.6 top and bottom, widened to clear an accent bar." },
1377
+ accentBar: {
1378
+ type: "object",
1379
+ description: "A coloured bar down one edge of the box, as on a callout. Painted inside the same shape, so it needs no second element.",
1380
+ properties: {
1381
+ color: { type: "string", description: 'Hex colour. Default "#8B5CF6".' },
1382
+ width: { type: "number", description: "Bar width in POINTS. Default 4." },
1383
+ side: { type: "string", description: '"left" (default) or "right".' }
1384
+ }
1385
+ }
1386
+ }
1387
+ };
1388
+ }
1346
1389
  function elementJsonSchema() {
1347
1390
  return {
1348
1391
  type: "object",
@@ -1350,10 +1393,10 @@ function elementJsonSchema() {
1350
1393
  properties: {
1351
1394
  id: { type: "string" },
1352
1395
  type: { type: "string", enum: Schema.ELEMENT_TYPES },
1353
- x: { type: "number", minimum: 0, maximum: 1 },
1354
- y: { type: "number", minimum: 0, maximum: 1 },
1355
- w: { type: "number", minimum: 0, maximum: 1 },
1356
- h: { type: "number", minimum: 0, maximum: 1 },
1396
+ x: { type: "number", minimum: 0, maximum: 1, description: "Left edge as a FRACTION of the slide width: 0 is the left edge, 0.5 the centre, 1 the right edge. Not pixels." },
1397
+ y: { type: "number", minimum: 0, maximum: 1, description: "Top edge as a FRACTION of the slide height: 0 is the top, 1 the bottom. Not pixels." },
1398
+ w: { type: "number", minimum: 0, maximum: 1, description: "Width as a FRACTION of the slide width. 1 spans the whole slide." },
1399
+ h: { type: "number", minimum: 0, maximum: 1, description: "Height as a FRACTION of the slide height. 1 spans the whole slide." },
1357
1400
  rotation: { type: "number" },
1358
1401
  z: { type: "integer" },
1359
1402
  locked: { type: "boolean" },
@@ -1361,7 +1404,7 @@ function elementJsonSchema() {
1361
1404
  href: { type: "string" },
1362
1405
  content: { type: "string" },
1363
1406
  format: { type: "string", enum: Schema.TEXT_FORMATS },
1364
- style: { type: "object" },
1407
+ style: styleJsonSchema(),
1365
1408
  src: { type: "string" },
1366
1409
  alt: { type: "string" },
1367
1410
  fit: { type: "string", enum: ["contain", "cover", "fill", "scale-down"] },
@@ -4151,7 +4194,7 @@ function getImageSize(bytes) {
4151
4194
  }
4152
4195
 
4153
4196
  // src/agent.ts
4154
- var VERSION = "0.5.2";
4197
+ var VERSION = "0.7.2";
4155
4198
  function toU8(input) {
4156
4199
  return input instanceof Uint8Array ? input : new Uint8Array(input);
4157
4200
  }