verstak 0.24.276 → 0.24.277

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.
@@ -4,7 +4,7 @@ import { Handling } from "./Elements.js";
4
4
  export function DraggableArea(draggingId, builder) {
5
5
  return (Div(builder, {
6
6
  mode: Mode.independentUpdate,
7
- onChange: b => {
7
+ script: b => {
8
8
  const e = b.native;
9
9
  const model = b.model;
10
10
  const dataForSensor = e.dataForSensor;
@@ -10,7 +10,7 @@ export declare function declareSplitter<T>(index: number, splitViewNode: RxNode<
10
10
  export declare function cursor(areaParams: ElPlace): void;
11
11
  export declare function Note(content: string, formatted?: boolean, declaration?: RxNodeDecl<El<HTMLElement, void>>): RxNode<El<HTMLElement, void>>;
12
12
  export declare function Group<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
13
- export declare function Handling<M = unknown>(onChange: Delegate<El<void, M>>): RxNode<El<void, M>>;
13
+ export declare function Handling<M = unknown>(script: Delegate<El<void, M>>): RxNode<El<void, M>>;
14
14
  export declare function SyntheticElement<M = unknown>(declaration?: RxNodeDecl<El<void, M>>, preset?: RxNodeDecl<El<void, M>>): RxNode<El<void, M>>;
15
15
  export declare class PanelDriver<T extends HTMLElement> extends HtmlDriver<T> {
16
16
  update(node: RxNode<El<T>>): void | Promise<void>;
@@ -19,7 +19,7 @@ export function Splitter(declaration, preset) {
19
19
  }
20
20
  export function rowBreak(shiftCursorDown) {
21
21
  RxNode.declare(Drivers.partition, {
22
- onChange: el => {
22
+ script: el => {
23
23
  const ownerEl = el.node.owner.element;
24
24
  if (ownerEl.splitView !== undefined) {
25
25
  el.style.display = "grid";
@@ -34,8 +34,8 @@ export function declareSplitter(index, splitViewNode) {
34
34
  return (Splitter({
35
35
  key,
36
36
  mode: Mode.independentUpdate,
37
- onCreate: el => el.native.className = `splitter ${key}`,
38
- onChange: b => {
37
+ creation: el => el.native.className = `splitter ${key}`,
38
+ script: b => {
39
39
  const e = b.native;
40
40
  const model = b.model;
41
41
  const dataForSensor = e.dataForSensor;
@@ -84,14 +84,14 @@ export function declareSplitter(index, splitViewNode) {
84
84
  }
85
85
  export function cursor(areaParams) {
86
86
  RxNode.declare(Drivers.cursor, {
87
- onChange: el => {
87
+ script: el => {
88
88
  el.place = areaParams;
89
89
  },
90
90
  });
91
91
  }
92
92
  export function Note(content, formatted, declaration) {
93
93
  return RxNode.declare(Drivers.note, declaration, {
94
- onChange: el => {
94
+ script: el => {
95
95
  if (formatted)
96
96
  el.native.innerHTML = content;
97
97
  else
@@ -102,8 +102,8 @@ export function Note(content, formatted, declaration) {
102
102
  export function Group(declaration, preset) {
103
103
  return RxNode.declare(Drivers.group, declaration, preset);
104
104
  }
105
- export function Handling(onChange) {
106
- return SyntheticElement({ mode: Mode.independentUpdate, onChange });
105
+ export function Handling(script) {
106
+ return SyntheticElement({ mode: Mode.independentUpdate, script });
107
107
  }
108
108
  export function SyntheticElement(declaration, preset) {
109
109
  return RxNode.declare(Drivers.synthetic, declaration, preset);
@@ -158,7 +158,7 @@ export class PanelDriver extends HtmlDriver {
158
158
  SyntheticElement({
159
159
  mode: Mode.independentUpdate,
160
160
  triggers: { stamp: el.node.stamp },
161
- onChange: () => {
161
+ script: () => {
162
162
  const native = el.native;
163
163
  const isHorizontal = el.splitView === Direction.horizontal;
164
164
  if (el.layoutInfo === undefined)
@@ -230,7 +230,7 @@ export class PanelDriver extends HtmlDriver {
230
230
  if (childDeclaration.triggers === undefined)
231
231
  childDeclaration.triggers = {};
232
232
  Object.defineProperty(childDeclaration.triggers, "index", { value: partCount });
233
- overrideMethod(childDeclaration, "onChange", el => {
233
+ overrideMethod(childDeclaration, "script", el => {
234
234
  if (isHorizontal)
235
235
  el.style.gridColumn = `${partCount + 1}`;
236
236
  else
@@ -255,9 +255,9 @@ export function isSplitViewPartition(childDriver) {
255
255
  return !childDriver.isPartition && childDriver !== Drivers.splitter && childDriver !== Drivers.synthetic;
256
256
  }
257
257
  function overrideMethod(declaration, method, func) {
258
- const baseOnChange = declaration[method];
259
- declaration[method] = baseOnChange !== undefined
260
- ? (el, base) => { baseOnChange(el, base); func(el); }
258
+ const baseScript = declaration[method];
259
+ declaration[method] = baseScript !== undefined
260
+ ? (el, base) => { baseScript(el, base); func(el); }
261
261
  : (el, base) => { base(); func(el); };
262
262
  }
263
263
  export const Drivers = {
@@ -6,7 +6,7 @@ export function OnClick(target, action, key) {
6
6
  key,
7
7
  mode: Mode.independentUpdate,
8
8
  triggers: { target },
9
- onChange: el => {
9
+ script: el => {
10
10
  const pointer = target.sensors.pointer;
11
11
  if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
12
12
  if (action instanceof Function) {
@@ -26,7 +26,7 @@ export function OnResize(target, action, key) {
26
26
  key,
27
27
  mode: Mode.independentUpdate,
28
28
  triggers: { target },
29
- onChange: el => {
29
+ script: el => {
30
30
  const resize = target.sensors.resize;
31
31
  resize.resizedElements.forEach(x => {
32
32
  action(x);
@@ -40,10 +40,10 @@ export function OnFocus(target, model, switchEditMode = undefined, key) {
40
40
  key,
41
41
  mode: Mode.independentUpdate,
42
42
  triggers: { target, model },
43
- onCreate: el => {
43
+ creation: el => {
44
44
  el.node.configureReactronic({ throttling: 0 });
45
45
  },
46
- onChange: el => {
46
+ script: el => {
47
47
  if (switchEditMode === undefined && !(target instanceof HTMLInputElement || target.hasAttribute("tabindex")))
48
48
  console.warn(`"${key !== null && key !== void 0 ? key : "noname"}" element must have "tabindex" attribute set in order to be focusable`);
49
49
  if (switchEditMode !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.24.276",
3
+ "version": "0.24.277",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
33
33
  "dependencies": {
34
- "reactronic": "^0.24.272"
34
+ "reactronic": "^0.24.273"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "20.11.17",