verstak 0.22.506 → 0.22.508

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.
@@ -32,7 +32,7 @@ export interface Bounds {
32
32
  heightOverlap?: boolean;
33
33
  alignContent?: To;
34
34
  alignFrame?: To;
35
- wrapping?: boolean;
35
+ flowWrap?: boolean;
36
36
  }
37
37
  export interface Place {
38
38
  exact: CellRange | undefined;
@@ -44,7 +44,7 @@ export interface Place {
44
44
  heightGrowth: number;
45
45
  alignContent: To;
46
46
  alignFrame: To;
47
- wrapping: boolean;
47
+ flowWrap: boolean;
48
48
  }
49
49
  export declare class Allocator {
50
50
  reset(): void;
@@ -27,7 +27,7 @@ export class Allocator {
27
27
  heightGrowth: (_f = bounds.heightGrowth) !== null && _f !== void 0 ? _f : 0,
28
28
  alignContent: (_g = bounds.alignContent) !== null && _g !== void 0 ? _g : To.Default,
29
29
  alignFrame: (_h = bounds.alignFrame) !== null && _h !== void 0 ? _h : To.Default,
30
- wrapping: (_j = bounds.wrapping) !== null && _j !== void 0 ? _j : false,
30
+ flowWrap: (_j = bounds.flowWrap) !== null && _j !== void 0 ? _j : false,
31
31
  };
32
32
  }
33
33
  }
@@ -62,7 +62,7 @@ export class GridBasedAllocator {
62
62
  heightMin: "", heightMax: "", heightGrowth: 0,
63
63
  alignContent: (_a = bounds === null || bounds === void 0 ? void 0 : bounds.alignContent) !== null && _a !== void 0 ? _a : To.Default,
64
64
  alignFrame: (_b = bounds === null || bounds === void 0 ? void 0 : bounds.alignFrame) !== null && _b !== void 0 ? _b : To.Default,
65
- wrapping: (_c = bounds === null || bounds === void 0 ? void 0 : bounds.wrapping) !== null && _c !== void 0 ? _c : false,
65
+ flowWrap: (_c = bounds === null || bounds === void 0 ? void 0 : bounds.flowWrap) !== null && _c !== void 0 ? _c : false,
66
66
  };
67
67
  if (bounds === null || bounds === void 0 ? void 0 : bounds.place) {
68
68
  result.exact = parseCellRange(bounds.place, { x1: 0, y1: 0, x2: 0, y2: 0 });
@@ -52,7 +52,7 @@ export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
52
52
  export declare enum LayoutKind {
53
53
  Block = 0,
54
54
  Grid = 1,
55
- Line = 2,
55
+ Part = 2,
56
56
  Group = 3,
57
57
  Text = 4
58
58
  }
@@ -65,7 +65,7 @@ export declare class AbstractDriver<T> {
65
65
  get isAuxiliary(): boolean;
66
66
  get isBlock(): boolean;
67
67
  get isGrid(): boolean;
68
- get isLine(): boolean;
68
+ get isPart(): boolean;
69
69
  constructor(name: string, layout: LayoutKind, createAllocator?: () => Allocator);
70
70
  initialize(block: VBlock<T>, native: T | undefined): void;
71
71
  finalize(block: VBlock<T>, isLeader: boolean): boolean;
@@ -58,7 +58,7 @@ export class VBlock {
58
58
  let ex = undefined;
59
59
  driver !== null && driver !== void 0 ? driver : (driver = AbstractDriver.group);
60
60
  name || (name = `${++owner.numerator}`);
61
- if (driver.isLine) {
61
+ if (driver.isPart) {
62
62
  const last = children.lastClaimedItem();
63
63
  if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === driver)
64
64
  ex = last;
@@ -97,7 +97,7 @@ export var LayoutKind;
97
97
  (function (LayoutKind) {
98
98
  LayoutKind[LayoutKind["Block"] = 0] = "Block";
99
99
  LayoutKind[LayoutKind["Grid"] = 1] = "Grid";
100
- LayoutKind[LayoutKind["Line"] = 2] = "Line";
100
+ LayoutKind[LayoutKind["Part"] = 2] = "Part";
101
101
  LayoutKind[LayoutKind["Group"] = 3] = "Group";
102
102
  LayoutKind[LayoutKind["Text"] = 4] = "Text";
103
103
  })(LayoutKind || (LayoutKind = {}));
@@ -112,7 +112,7 @@ export class AbstractDriver {
112
112
  get isAuxiliary() { return (this.layout & 2) === 2; }
113
113
  get isBlock() { return this.layout === LayoutKind.Block; }
114
114
  get isGrid() { return this.layout === LayoutKind.Grid; }
115
- get isLine() { return this.layout === LayoutKind.Line; }
115
+ get isPart() { return this.layout === LayoutKind.Part; }
116
116
  initialize(block, native) {
117
117
  var _a;
118
118
  const b = block;
@@ -149,7 +149,7 @@ export class AbstractDriver {
149
149
  if (heightGrowth === undefined) {
150
150
  b.place = place;
151
151
  const host = b.host;
152
- if (host.driver.isLine) {
152
+ if (host.driver.isPart) {
153
153
  const growth = (_a = place === null || place === void 0 ? void 0 : place.heightGrowth) !== null && _a !== void 0 ? _a : 0;
154
154
  if (growth > 0 && ((_c = (_b = host.place) === null || _b === void 0 ? void 0 : _b.heightGrowth) !== null && _c !== void 0 ? _c : 0) < growth)
155
155
  host.driver.arrange(host, undefined, growth);
@@ -163,7 +163,7 @@ export class AbstractDriver {
163
163
  heightMin: "", heightMax: "", heightGrowth,
164
164
  alignContent: To.Default,
165
165
  alignFrame: To.Default,
166
- wrapping: false,
166
+ flowWrap: false,
167
167
  };
168
168
  else
169
169
  b.place.heightGrowth = heightGrowth;
@@ -296,20 +296,20 @@ function runRenderNestedTreesThenDo(error, action) {
296
296
  let p1 = undefined;
297
297
  let p2 = undefined;
298
298
  let redeploy = false;
299
- let lineHost = owner;
299
+ let partHost = owner;
300
300
  for (const item of children.items()) {
301
301
  if (Transaction.isCanceled)
302
302
  break;
303
303
  const block = item.instance;
304
304
  const driver = block.driver;
305
305
  const opt = block.args;
306
- if (!driver.isLine) {
306
+ if (!driver.isPart) {
307
307
  const place = allocator.allocate(opt);
308
308
  driver.arrange(block, place, undefined);
309
309
  }
310
310
  else
311
311
  allocator.lineFeed();
312
- const host = driver.isLine ? owner : lineHost;
312
+ const host = driver.isPart ? owner : partHost;
313
313
  redeploy = markToRedeployIfNecessary(redeploy, host, item, children, sequential);
314
314
  const priority = (_a = opt === null || opt === void 0 ? void 0 : opt.priority) !== null && _a !== void 0 ? _a : Priority.SyncP0;
315
315
  if (priority === Priority.SyncP0)
@@ -318,8 +318,8 @@ function runRenderNestedTreesThenDo(error, action) {
318
318
  p1 = push(item, p1);
319
319
  else
320
320
  p2 = push(item, p2);
321
- if (ownerIsBlock && driver.isLine)
322
- lineHost = block;
321
+ if (ownerIsBlock && driver.isPart)
322
+ partHost = block;
323
323
  }
324
324
  if (!Transaction.isCanceled && (p1 !== undefined || p2 !== undefined))
325
325
  promised = startIncrementalRendering(current, children, p1, p2).then(() => action(error), e => action(e));
@@ -1,8 +1,8 @@
1
1
  import { VBlock, Place, BlockArgs } from "../core/api";
2
2
  import { HtmlDriver } from "./HtmlDriver";
3
3
  export declare function Block<M = unknown, R = void>(name: string, args: BlockArgs<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
4
- export declare function PlainText(content: string, wrapping?: boolean): VBlock<HTMLElement, void, void>;
5
- export declare function HtmlText(content: string, wrapping?: boolean): VBlock<HTMLElement, void, void>;
4
+ export declare function PlainText(content: string, name?: string, args?: Partial<BlockArgs<HTMLElement, void, void>>): VBlock<HTMLElement, void, void>;
5
+ export declare function HtmlText(content: string, name?: string, args?: Partial<BlockArgs<HTMLElement, void, void>>): VBlock<HTMLElement, void, void>;
6
6
  export declare function Grid<M = unknown, R = void>(name: string, args: BlockArgs<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
7
7
  export declare function Line<T = void>(claim: (x: void) => T): VBlock<HTMLElement>;
8
8
  export declare function lineFeed(args?: BlockArgs<HTMLElement, void, void>, noCoalescing?: boolean): VBlock<HTMLElement>;
@@ -3,23 +3,23 @@ import { HtmlDriver } from "./HtmlDriver";
3
3
  export function Block(name, args) {
4
4
  return VBlock.claim(name, args, VerstakTags.block);
5
5
  }
6
- export function PlainText(content, wrapping) {
7
- return VBlock.claim("", { wrapping, render(e) { e.innerText = content; } }, VerstakTags.text);
6
+ export function PlainText(content, name, args) {
7
+ return VBlock.claim(name !== null && name !== void 0 ? name : "", Object.assign(Object.assign({}, args), { render(e) { e.innerText = content; } }), VerstakTags.text);
8
8
  }
9
- export function HtmlText(content, wrapping) {
10
- return VBlock.claim("", { wrapping, render(e) { e.innerHTML = content; } }, VerstakTags.text);
9
+ export function HtmlText(content, name, args) {
10
+ return VBlock.claim(name !== null && name !== void 0 ? name : "", Object.assign(Object.assign({}, args), { render(e) { e.innerHTML = content; } }), VerstakTags.text);
11
11
  }
12
12
  export function Grid(name, args) {
13
13
  return VBlock.claim(name, args, VerstakTags.grid);
14
14
  }
15
15
  export function Line(claim) {
16
- const result = VBlock.claim("", EMPTY_RENDER, VerstakTags.line);
16
+ const result = VBlock.claim("", EMPTY_RENDER, VerstakTags.part);
17
17
  claim();
18
- VBlock.claim("", EMPTY_RENDER, VerstakTags.line);
18
+ VBlock.claim("", EMPTY_RENDER, VerstakTags.part);
19
19
  return result;
20
20
  }
21
21
  export function lineFeed(args, noCoalescing) {
22
- return VBlock.claim("", args !== null && args !== void 0 ? args : EMPTY_RENDER, VerstakTags.line);
22
+ return VBlock.claim("", args !== null && args !== void 0 ? args : EMPTY_RENDER, VerstakTags.part);
23
23
  }
24
24
  export function Group(name, args) {
25
25
  return VBlock.claim(name, args, VerstakTags.group);
@@ -75,11 +75,11 @@ export class VerstakDriver extends HtmlDriver {
75
75
  const h = AlignToCss[alignContent & 0b11];
76
76
  const t = TextAlignCss[alignContent & 0b11];
77
77
  css.justifyContent = v;
78
- css.alignItems = h;
78
+ css.alignContent = h;
79
79
  css.textAlign = t;
80
80
  }
81
81
  else
82
- css.justifyContent = css.alignItems = css.textAlign = "";
82
+ css.justifyContent = css.alignContent = css.textAlign = "";
83
83
  }
84
84
  const heightGrowth = (_o = place === null || place === void 0 ? void 0 : place.heightGrowth) !== null && _o !== void 0 ? _o : 0;
85
85
  const alignFrame = (_p = place === null || place === void 0 ? void 0 : place.alignFrame) !== null && _p !== void 0 ? _p : To.Default;
@@ -97,10 +97,10 @@ export class VerstakDriver extends HtmlDriver {
97
97
  else
98
98
  css.alignSelf = css.justifySelf = "";
99
99
  }
100
- const wrapping = (_s = place === null || place === void 0 ? void 0 : place.wrapping) !== null && _s !== void 0 ? _s : false;
101
- if (wrapping !== ((_t = ex === null || ex === void 0 ? void 0 : ex.wrapping) !== null && _t !== void 0 ? _t : false)) {
102
- if (wrapping)
103
- native.setAttribute("wrapping", "");
100
+ const flowWrap = (_s = place === null || place === void 0 ? void 0 : place.flowWrap) !== null && _s !== void 0 ? _s : false;
101
+ if (flowWrap !== ((_t = ex === null || ex === void 0 ? void 0 : ex.flowWrap) !== null && _t !== void 0 ? _t : false)) {
102
+ if (flowWrap)
103
+ native.setAttribute("wrapping", "true");
104
104
  else
105
105
  native.removeAttribute("wrapping");
106
106
  }
@@ -116,8 +116,8 @@ export class VerstakDriver extends HtmlDriver {
116
116
  super.arrange(block, place, heightGrowth);
117
117
  }
118
118
  render(block) {
119
- if (!block.driver.isLine)
120
- VBlock.claim("", EMPTY_RENDER, VerstakTags.line);
119
+ if (!block.driver.isPart)
120
+ VBlock.claim("", EMPTY_RENDER, VerstakTags.part);
121
121
  return super.render(block);
122
122
  }
123
123
  }
@@ -125,7 +125,7 @@ const VerstakTags = {
125
125
  block: new VerstakDriver("v-block", LayoutKind.Block),
126
126
  text: new VerstakDriver("v-text", LayoutKind.Text),
127
127
  grid: new VerstakDriver("v-grid", LayoutKind.Grid, () => new GridBasedAllocator()),
128
- line: new VerstakDriver("v-line", LayoutKind.Line),
128
+ part: new VerstakDriver("v-part", LayoutKind.Part),
129
129
  group: new VerstakDriver("v-group", LayoutKind.Group),
130
130
  };
131
131
  const EMPTY_RENDER = { render() { } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.22.506",
3
+ "version": "0.22.508",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",