@polotno/schema 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,6 +63,7 @@ oldest format, not the newest.
63
63
  | 2 | Filter `intensity` moved from `-100..100` to `-1..1`. |
64
64
  | 3 | Text backgrounds render as per-line polygons; pre-v3 rich text is stamped `legacyBackground` to keep the old full rect. |
65
65
  | 4 | Video time anchoring changed. Marker only — no document transform. |
66
+ | 5 | `move` animations travel a share of the page's shorter side, not a fixed 200px; saved `strength` is rescaled to match. |
66
67
 
67
68
  Steps 1 and 3 apply only to the modern text renderers, which every converter
68
69
  uses.
package/lib/defaults.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const TABLE_CELL_OVERRIDABLE_KEYS: readonly ["fontSize", "fontFamily", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fill", "align", "verticalAlign", "lineHeight", "letterSpacing", "strokeWidth", "stroke", "cellBackground", "cellPadding"];
1
+ export declare const TABLE_CELL_OVERRIDABLE_KEYS: readonly ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textDecoration', 'textTransform', 'fill', 'align', 'verticalAlign', 'lineHeight', 'letterSpacing', 'strokeWidth', 'stroke', 'cellBackground', 'cellPadding'];
2
2
  /**
3
3
  * Resolve cell inheritance: every overridable text property a cell leaves
4
4
  * undefined is filled from the table element (canvas parity — no fallback
@@ -25,10 +25,8 @@ export declare const resolveTableCellBorder: (cell: Record<string, any>, element
25
25
  * stroke intrudes and the other half lives in the neighbour. `cell` must carry
26
26
  * its grid position (`row`, `col`, and the spans when it spans).
27
27
  *
28
- * Mirrors the editor's `TableCell.borderInsets` (polotno's table-model.ts),
29
- * which is what the canvas places cell text with — that model still owns its
30
- * own copy because it resolves borders through MST views with an isAlive
31
- * guard.
28
+ * The editor's `TableCell.borderInsets` and @polotno/core/table's content
29
+ * box both take it.
32
30
  */
33
31
  export declare const tableCellBorderInsets: (cell: Record<string, any>, element: Record<string, any>) => {
34
32
  top: number;
@@ -38,18 +36,18 @@ export declare const tableCellBorderInsets: (cell: Record<string, any>, element:
38
36
  };
39
37
  export declare const TEXT_DEFAULTS: {
40
38
  readonly fontSize: 14;
41
- readonly fontFamily: "Roboto";
42
- readonly fontWeight: "normal";
43
- readonly fontStyle: "normal";
39
+ readonly fontFamily: 'Roboto';
40
+ readonly fontWeight: 'normal';
41
+ readonly fontStyle: 'normal';
44
42
  readonly lineHeight: 1.2;
45
43
  readonly letterSpacing: 0;
46
- readonly textTransform: "none";
47
- readonly textDecoration: "";
48
- readonly align: "center";
49
- readonly fill: "black";
50
- readonly stroke: "black";
44
+ readonly textTransform: 'none';
45
+ readonly textDecoration: '';
46
+ readonly align: 'center';
47
+ readonly fill: 'black';
48
+ readonly stroke: 'black';
51
49
  readonly strokeWidth: 0;
52
- readonly strokeLineJoin: "round";
50
+ readonly strokeLineJoin: 'round';
53
51
  readonly curveEnabled: false;
54
52
  readonly curvePower: 0.5;
55
53
  };
@@ -80,8 +78,8 @@ export declare const MIN_FONT_SIZE = 1;
80
78
  * the table", which is not a size to clamp.
81
79
  */
82
80
  export declare const clampFontSize: <T extends number | undefined>(size: T) => T;
83
- export declare const BLEND_MODES: readonly ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
81
+ export declare const BLEND_MODES: readonly ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
84
82
  export declare const GROUP_BLEND_MODES: readonly ["pass-through", "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
85
83
  /** The page size, on both sides, of a design that names none. */
86
84
  export declare const DESIGN_SIZE = 1080;
87
- export declare const ANIMATION_EASINGS: readonly ["linear", "easeIn", "easeOut", "easeInOut", "backIn", "backOut", "backInOut"];
85
+ export declare const ANIMATION_EASINGS: readonly ['linear', 'easeIn', 'easeOut', 'easeInOut', 'backIn', 'backOut', 'backInOut'];
package/lib/defaults.js CHANGED
@@ -5,9 +5,9 @@
5
5
  // so runtime consumers can import `@polotno/schema/defaults` without pulling
6
6
  // the validator.
7
7
  // Table-cell properties that inherit from the table element when a cell
8
- // leaves them undefined. Shared by the editor's table model and the svg/html
9
- // exporters so the inheritance vocabulary can't drift. (pdf-export uses a
10
- // deliberate subset without stroke/strokeWidth — see its table.ts.)
8
+ // leaves them undefined. Shared by the editor's table model and
9
+ // @polotno/core/table, which every exporter resolves cells through, so the
10
+ // inheritance vocabulary can't drift.
11
11
  export const TABLE_CELL_OVERRIDABLE_KEYS = [
12
12
  'fontSize',
13
13
  'fontFamily',
@@ -63,10 +63,8 @@ export const resolveTableCellBorder = (cell, element, side) => {
63
63
  * stroke intrudes and the other half lives in the neighbour. `cell` must carry
64
64
  * its grid position (`row`, `col`, and the spans when it spans).
65
65
  *
66
- * Mirrors the editor's `TableCell.borderInsets` (polotno's table-model.ts),
67
- * which is what the canvas places cell text with — that model still owns its
68
- * own copy because it resolves borders through MST views with an isAlive
69
- * guard.
66
+ * The editor's `TableCell.borderInsets` and @polotno/core/table's content
67
+ * box both take it.
70
68
  */
71
69
  export const tableCellBorderInsets = (cell, element) => {
72
70
  const rowSpan = cell.rowSpan || 1;